[PyDelhi] [Query] [DRF] Raw SQL Query by passing Model and Model Serializer

ragsagar ragsagar at gmail.com
Sat Oct 31 15:44:19 EDT 2015


On Sat, Oct 31, 2015 at 2:14 AM, Aniket Maithani <maithani.aniket at gmail.com>
wrote:

>
>
>
> On Sat, Oct 31, 2015 at 3:26 AM, Raakesh kumar <kumar3180 at gmail.com>
> wrote:
>
>>
>> Just for my curiosity, why do you want to remove model interaction? I
>> mean you can achieve it with models also
>>
>
>
> Well point being I already have the data in the database (parsed from the
> website) . Which I have exported. And since I know the data is going to
> remain unchanged for some-time I feel there is no need to create model for
> the same (Correct me If I am wrong here). Therefore I just want simple
> query and output mechanism, that's all.
>
>
Use the management command `inspectdb`. It will inspect your existing
tables and create models for you. Then you can use DRF's generic views
itself.  Read more here.
https://docs.djangoproject.com/en/1.8/howto/legacy-databases/

-- 
blog : ragsagar.wordpress.com
mail id : python -c "print '@'.join(['ragsagar','.'.join([x for x in
['gmail','com']])])"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ncr-python.in/attachments/20151031/0ae815da/attachment.html>


More information about the Ncr-Python.in mailing list