It's used for the documented `QuerySet.raw` usage and
[https://github.com/django/django/blob/4527d5db0f0a939439b9373f7a9a4eee3386afff/django/db/models/query_utils.py#L23
abused] for
[https://github.com/django/django/blob/4527d5db0f0a939439b9373f7a9a4eee3386afff/django/db/models/query_utils.py#L221-L254
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`.
--
Ticket URL: <https://code.djangoproject.com/ticket/30988>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* owner: nobody => Simon Charette
* status: new => assigned
* has_patch: 0 => 1
* stage: Unreviewed => Accepted
Comment:
[https://github.com/django/django/pull/12073 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/30988#comment:1>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"11e327a3ff84e16ceace13ea6ec408a93ca9e72c" 11e327a3]:
{{{
#!CommitTicketReference repository=""
revision="11e327a3ff84e16ceace13ea6ec408a93ca9e72c"
Fixed #30988 -- Deprecated the InvalidQuery exception.
It was barely documented without pointers at its defining location and
was abused to prevent misuse of the QuerySet field deferring feature.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30988#comment:2>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"68e3ca13d771a8f08a8d1c272308cd44b4dcfa76" 68e3ca13]:
{{{
#!CommitTicketReference repository=""
revision="68e3ca13d771a8f08a8d1c272308cd44b4dcfa76"
Refs #30988 -- Removed InvalidQuery exception per deprecation timeline.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30988#comment:3>