1
0
mirror of https://github.com/django/django.git synced 2025-10-25 14:46:09 +00:00

Refs #29799 -- Added field instance lookups to suggestions in FieldErrors.

Bug in cd1afd553f.
This commit is contained in:
Mariusz Felisiak
2023-03-28 19:18:48 +02:00
committed by GitHub
parent fcc7dc5781
commit 3afdc9e9b4
2 changed files with 13 additions and 3 deletions

View File

@@ -1305,7 +1305,7 @@ class Query(BaseExpression):
else:
output_field = lhs.output_field.__class__
suggested_lookups = difflib.get_close_matches(
name, output_field.get_lookups()
name, lhs.output_field.get_lookups()
)
if suggested_lookups:
suggestion = ", perhaps you meant %s?" % " or ".join(suggested_lookups)