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.
This commit is contained in:
Simon Charette 2019-11-15 16:20:07 -05:00 committed by Mariusz Felisiak
parent cbe4d6203f
commit 11e327a3ff
8 changed files with 82 additions and 15 deletions

View file

@ -170,8 +170,9 @@ last names were both retrieved on demand when they were printed.
There is only one field that you can't leave out - the primary key
field. Django uses the primary key to identify model instances, so it
must always be included in a raw query. An ``InvalidQuery`` exception
will be raised if you forget to include the primary key.
must always be included in a raw query. A
:class:`~django.core.exceptions.FieldDoesNotExist` exception will be raised if
you forget to include the primary key.
Adding annotations
------------------