#35413: FieldError: Unsupported lookup error message can be confusing.
-------------------------------------+-------------------------------------
Reporter: Alex | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Database layer | Version: 5.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Amir Karimi):
Replying to [comment:1 Sarah Boyce]:
> Replicated, this is also true of other fields.
> I agree that saying something like `Unsupported lookup 'gt__foo'`,
`Unsupported lookup 'gt__'`, and `Unsupported lookup 'gt__lt'` would be
clearer.
If we just pass down `LOOKUP_SEP.join(arg.split(LOOKUP_SEP)[1:])` to the
`build_lookup` method, it can print out the input lookup entirely.
It outputs`'gt__foo'`, `'gt__' `, and `'gt__lt' `.
It can be an argument to the `try_transform` method. Not sure wether
`name` is needed or not. Thoughts?
--
Ticket URL: <
https://code.djangoproject.com/ticket/35413#comment:2>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.