#14622: ValuesListQuerySet used with a foo__in filter breaks in SQL generation
------------------------------------------+---------------------------------
 Reporter:  calvinspealman                |       Owner:  nobody    
   Status:  new                           |   Milestone:            
Component:  Database layer (models, ORM)  |     Version:  1.2       
 Keywords:                                |       Stage:  Unreviewed
Has_patch:  0                             |  
------------------------------------------+---------------------------------
 A similar bug was reported in #10181 but I do not believe it was entirely
 fixed. The testcase added by changeset [9951] only tests

 {{{
 >>> Tag.objects.filter(id__in=Tag.objects.filter(id__in=[]))
 }}}

 However, this is using an explicit empty list and not an empty
 ValuesListQuerySet. Something like

 {{{
 >>>
 
Tag.objects.filter(id__in=Tag.objects.filter(id__in=Tag.objects.none().values_list('id',
 flat=True)))
 }}}

 will fail in SQL generation, because an empty ValuesListQuerySet() seems
 to be missing several key attributes. This seems to be because
 ValuesQuerySet._clone() method is called with setup=False and it never
 establishes the attributes expected.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/14622>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to