Changes between Initial Version and Version 1 of Ticket #18583, comment 2


Ignore:
Timestamp:
02/23/2013 03:43:09 PM (2 years ago)
Author:
fgallina
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #18583, comment 2

    initial v1  
    22
    33Given this full example:
    4 
     4{{{
    55    #models
    66    from django.utils.encoding import python_2_unicode_compatible
     
    3737        def __str__(self):
    3838            return str(self.pk)
     39}}}
    3940
    4041The following query:
    4142
    42     C.objects.exclude(b__a__d__group__in=[foo]).order_by('pk')
     43    {{{ C.objects.exclude(b__a__d__group__in=[foo]).order_by('pk') }}}
    4344
    4445Results in:
    45 
     46{{{
    4647    SELECT "queries_c"."id", "queries_c"."b_id" FROM "queries_c"
    4748       INNER JOIN "queries_b" ON ("queries_c"."b_id" = "queries_b"."id")
     
    4950                   (SELECT U3."a_id" FROM "queries_d" U3 WHERE U3."group_id" IN (1))
    5051                   AND "queries_b"."a_id" IS NOT NULL))
     52}}}
    5153
    5254Which is correct, as the filtering is taken to the a.id field (see the inner SELECT).
Back to Top