summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-09-13 03:17:46 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-09-13 03:17:46 +0000
commitbb77006adefae2db3fae0213779fc30254c1b98f (patch)
treeaf6bfee7948bcbe4f25694a288142605cfb7ea13 /django
parenta7d01ec9b4b7a41d5e61498993949b1285db4e45 (diff)
Use the correct column in custom column handling.
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6119 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/db/models/sql/query.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index 21ce5282d4..97b4ee1a47 100644
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -506,7 +506,7 @@ class Query(object):
raise TypeError("Joins on field %r not permitted."
% name)
- name = target_col or name
+ col = target_col or target_field.column
if target_field is opts.pk and last:
# An optimization: if the final join is against a primary key,
@@ -516,7 +516,7 @@ class Query(object):
self.unref_alias(alias)
join = self.alias_map[last[-1]][ALIAS_JOIN]
alias = join[LHS_ALIAS]
- name = join[LHS_JOIN_COL]
+ col = join[LHS_JOIN_COL]
if (lookup_type == 'isnull' and value is True):
# If the comparison is against NULL, we need to use a left outer
@@ -525,7 +525,7 @@ class Query(object):
# efficient at the database level.
self.alias_map[joins[0]][ALIAS_JOIN][JOIN_TYPE] = self.LOUTER
- self.where.add([alias, name, orig_field, lookup_type, value],
+ self.where.add([alias, col, orig_field, lookup_type, value],
connection)
if negate:
self.alias_map[last[0]][ALIAS_JOIN][JOIN_TYPE] = self.LOUTER