mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #23697 -- Improved ForeignObject.get_lookup_constraint() error message.
This commit is contained in:
committed by
Tim Graham
parent
a4a58811b9
commit
00e667728b
@@ -1766,7 +1766,12 @@ class ForeignObject(RelatedField):
|
||||
root_constraint = constraint_class()
|
||||
assert len(targets) == len(sources)
|
||||
if len(lookups) > 1:
|
||||
raise exceptions.FieldError('Relation fields do not support nested lookups')
|
||||
raise exceptions.FieldError(
|
||||
"Cannot resolve keyword %r into field. Choices are: %s" % (
|
||||
lookups[0],
|
||||
", ".join(f.name for f in self.model._meta.get_fields()),
|
||||
)
|
||||
)
|
||||
lookup_type = lookups[0]
|
||||
|
||||
def get_normalized_value(value):
|
||||
|
||||
Reference in New Issue
Block a user