#25319: QuerySet not working with Union + Exclude
----------------------------------------------+--------------------
     Reporter:  nanchenchen                   |      Owner:  nobody
         Type:  Bug                           |     Status:  new
    Component:  Database layer (models, ORM)  |    Version:  1.7
     Severity:  Normal                        |   Keywords:
 Triage Stage:  Unreviewed                    |  Has patch:  0
Easy pickings:  0                             |      UI/UX:  0
----------------------------------------------+--------------------
 I created a few QuerySets and tried to union them.
 However, as long as my querysets contain exclude (i.e., I called
 queryset.exclude to get the new one), the union operation will be fail.

 The error message is "No exception message supplied"

 I tracked it and found it failed over here:

 {{{
 /home/vagrant/.virtualenvs/textvisdrg/local/lib/python2.7/site-
 packages/django/db/models/sql/query.py in change_aliases
     def change_aliases(self, change_map):
         """
         Changes the aliases in change_map (which maps old-alias -> new-
 alias),
         relabelling any references to them in select columns and the where
         clause.
         """
         assert
 set(change_map.keys()).intersection(set(change_map.values())) == set() ...
         def relabel_column(col):
             if isinstance(col, (list, tuple)):
                 old_alias = col[0]
                 return (change_map.get(old_alias, old_alias), col[1])
             else:
 }}}

 It's Line 776.

--
Ticket URL: <https://code.djangoproject.com/ticket/25319>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/054.1a45cba4f9f2e9fb7fecf4a950a80c13%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to