#30988 closed Cleanup/optimization (fixed)
Deprecate the barely documented InvalidQuery exception.
Reported by: | Simon Charette | Owned by: | Simon Charette |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The django.db.models.query.InvalidQuery
exception is only mentioned once by name in the documentation without reference to its defining module.
It's used for the documented QuerySet.raw
usage and abused for field deferring select related misuse.
I suggest we replace the documented usage by raising FieldDoesNotExist
instead and the latter undocumented abuse by raising FieldError
while providing a deprecation shim to warn on usages of except InvalidQuery
.
Change History (3)
comment:1 by , 5 years ago
Has patch: | set |
---|---|
Owner: | changed from | to
Status: | new → assigned |
Triage Stage: | Unreviewed → Accepted |
Note:
See TracTickets
for help on using tickets.
PR