summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-03-21 13:53:37 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-03-21 13:53:37 +0000
commit9512ebba44307cb4562f85ea433e757af678230a (patch)
treec532d09ffbfbf8073e6998b6f0c8368b6c76cb60
parent7388d016805c6b5416aca224b0964a8a63fa0a3f (diff)
queryset-refactor: Removed an unneeded comparison to NULL for non-nullable
ForeignKey field lookups. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7344 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/db/models/sql/query.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index 370ef357b0..34b3c530b3 100644
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -934,10 +934,13 @@ class Query(object):
if not merged:
self.where.negate()
if final > 1 and lookup_type != 'isnull':
- j_col = self.alias_map[alias][RHS_JOIN_COL]
- entry = Node([(alias, j_col, None, 'isnull', True)])
- entry.negate()
- self.where.add(entry, AND)
+ for alias in join_list:
+ if self.alias_map[alias] == self.LOUTER:
+ j_col = self.alias_map[alias][RHS_JOIN_COL]
+ entry = Node([(alias, j_col, None, 'isnull', True)])
+ entry.negate()
+ self.where.add(entry, AND)
+ break
def add_q(self, q_object):
"""