summaryrefslogtreecommitdiff
path: root/django/db/models
diff options
context:
space:
mode:
authorKaren Tracey <kmtracey@gmail.com>2010-02-10 19:21:52 +0000
committerKaren Tracey <kmtracey@gmail.com>2010-02-10 19:21:52 +0000
commitbb6b9aa47279e78d2a17a571da1a1523e3b70c5c (patch)
tree5384ef457cfea03373ce533a6d3a88b47d50163b /django/db/models
parent225c413b08b3e034604ffbaed604a6867d7b712e (diff)
Fixed #11535: Corrected SQL generated for queries involving generic relations and ORed Q objects. Thanks to brianglass for report, tobias for fix and test, and Alex for review.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12405 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/models')
-rw-r--r--django/db/models/sql/query.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index 88b3571931..dde1494662 100644
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -1100,13 +1100,13 @@ class Query(object):
for child in q_object.children:
if connector == OR:
refcounts_before = self.alias_refcount.copy()
+ self.where.start_subtree(connector)
if isinstance(child, Node):
- self.where.start_subtree(connector)
self.add_q(child, used_aliases)
- self.where.end_subtree()
else:
self.add_filter(child, connector, q_object.negated,
can_reuse=used_aliases)
+ self.where.end_subtree()
if connector == OR:
# Aliases that were newly added or not used at all need to
# be promoted to outer joins if they are nullable relations.