mirror of
https://github.com/django/django.git
synced 2025-10-02 23:04:53 +00:00
Fixed #2348 -- Improved error reporting when query filter arguments are
misspelt. Variation on a patch from Karen Tracey. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4470 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
f0a3f5fc1a
commit
e57ce6b157
2 changed files with 19 additions and 2 deletions
|
@ -881,8 +881,14 @@ def lookup_inner(path, lookup_type, value, opts, table, column):
|
|||
new_opts = field.rel.to._meta
|
||||
new_column = new_opts.pk.column
|
||||
join_column = field.column
|
||||
|
||||
raise FieldFound
|
||||
raise FieldFound
|
||||
elif path:
|
||||
# For regular fields, if there are still items on the path,
|
||||
# an error has been made. We munge "name" so that the error
|
||||
# properly identifies the cause of the problem.
|
||||
name += LOOKUP_SEPARATOR + path[0]
|
||||
else:
|
||||
raise FieldFound
|
||||
|
||||
except FieldFound: # Match found, loop has been shortcut.
|
||||
pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue