[p2pu-dev] A little SQL/Django ORM riddle to start off the week!

Dirk Uys dirk at p2pu.org
Wed Jan 9 09:03:50 UTC 2013


Hi Siddharth

Welcome! I think you are on to something with extra. I see you can specify
extra tables to include, so maybe that can work?

I was thinking about doing a custom SQL query using raw, but maybe extra
can keep it a little less custom?

I had too look up "decorum" - don't think you're breaking any :)

Cheers
Dirk

On Tue, Jan 8, 2013 at 2:25 PM, Siddharth Sarda
<siddharthsarda01 at gmail.com>wrote:

> Hey,
>
> One way to do this is using Django's extra queryset modifier.
>
>
> https://docs.djangoproject.com/en/1.0/ref/models/querysets/#extra-select-none-where-none-params-none-tables-none-order-by-none-select-params-none
>
> I have both the queries and the original Django queryset and will try to
> rewrite them using extra.
>
> Thanks
> Siddharth
>
> P.S.: I am new here. So a warm hello. Also please let me know if I am
> violating any decorum.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p2pu.org/pipermail/p2pu-dev/attachments/20130109/b2ab06c4/attachment.html>


More information about the p2pu-dev mailing list