From bec0b2a8c637ba2dc3745ad0c1e68ccc6c2f78bd Mon Sep 17 00:00:00 2001 From: Anssi Kääriäinen Date: Sat, 2 Nov 2013 22:35:45 +0200 Subject: Fixed #14511 -- bug in .exclude() query --- django/db/models/sql/datastructures.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'django/db/models/sql/datastructures.py') diff --git a/django/db/models/sql/datastructures.py b/django/db/models/sql/datastructures.py index b32148eba5..f45ecaf76d 100644 --- a/django/db/models/sql/datastructures.py +++ b/django/db/models/sql/datastructures.py @@ -4,6 +4,21 @@ the SQL domain. """ +class Col(object): + def __init__(self, alias, col): + self.alias = alias + self.col = col + + def as_sql(self, qn, connection): + return '%s.%s' % (qn(self.alias), self.col), [] + + def prepare(self): + return self + + def relabeled_clone(self, relabels): + return self.__class__(relabels.get(self.alias, self.alias), self.col) + + class EmptyResultSet(Exception): pass -- cgit v1.3