mirror of
https://github.com/django/django.git
synced 2025-10-25 22:56:12 +00:00
Fixed #9778 -- Added some special casing of the "Join on field 'abc'" error
message. It now gives an extra hint if there's a chance you just made a typo in the lookup type. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9620 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -1455,7 +1455,10 @@ class BaseQuery(object):
|
||||
self.update_dupe_avoidance(dupe_opts, dupe_col, alias)
|
||||
|
||||
if pos != len(names) - 1:
|
||||
raise FieldError("Join on field %r not permitted." % name)
|
||||
if pos == len(names) - 2:
|
||||
raise FieldError("Join on field %r not permitted. Did you misspell %r for the lookup type?" % (name, names[pos + 1]))
|
||||
else:
|
||||
raise FieldError("Join on field %r not permitted." % name)
|
||||
|
||||
return field, target, opts, joins, last, extra_filters
|
||||
|
||||
|
||||
Reference in New Issue
Block a user