mirror of
https://github.com/django/django.git
synced 2025-06-05 03:29:12 +00:00
magic-removal: Fixed bug in parse_lookup introduced in 2150, and tidied up a bit
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2236 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
1308017f62
commit
5366beeb70
@ -574,9 +574,7 @@ def parse_lookup(kwarg_items, opts):
|
|||||||
tables, joins, where, params = [], SortedDict(), [], []
|
tables, joins, where, params = [], SortedDict(), [], []
|
||||||
|
|
||||||
for kwarg, value in kwarg_items:
|
for kwarg, value in kwarg_items:
|
||||||
if value is None:
|
if value is not None:
|
||||||
pass
|
|
||||||
else:
|
|
||||||
path = kwarg.split(LOOKUP_SEPARATOR)
|
path = kwarg.split(LOOKUP_SEPARATOR)
|
||||||
# Extract the last elements of the kwarg.
|
# Extract the last elements of the kwarg.
|
||||||
# The very-last is the clause (equals, like, etc).
|
# The very-last is the clause (equals, like, etc).
|
||||||
@ -599,11 +597,11 @@ def parse_lookup(kwarg_items, opts):
|
|||||||
if len(path) < 1:
|
if len(path) < 1:
|
||||||
raise TypeError, "Cannot parse keyword query %r" % kwarg
|
raise TypeError, "Cannot parse keyword query %r" % kwarg
|
||||||
|
|
||||||
tables2, joins2, where2, params2 = lookup_inner(path, clause, value, opts, opts.db_table, None)
|
tables2, joins2, where2, params2 = lookup_inner(path, clause, value, opts, opts.db_table, None)
|
||||||
tables.extend(tables2)
|
tables.extend(tables2)
|
||||||
joins.update(joins2)
|
joins.update(joins2)
|
||||||
where.extend(where2)
|
where.extend(where2)
|
||||||
params.extend(params2)
|
params.extend(params2)
|
||||||
return tables, joins, where, params
|
return tables, joins, where, params
|
||||||
|
|
||||||
class FieldFound(Exception):
|
class FieldFound(Exception):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user