﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
25319	QuerySet not working with Union + Exclude	nanchenchen	nobody	"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."	Bug	closed	Database layer (models, ORM)	1.7	Normal	needsinfo			Unreviewed	0	0	0	0	0	0
