mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
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:
committed by
Mariusz Felisiak
parent
cbe4d6203f
commit
11e327a3ff
@@ -39,6 +39,9 @@ details on these changes.
|
||||
* The undocumented usage of the :lookup:`isnull` lookup with non-boolean values
|
||||
as the right-hand side will no longer be allowed.
|
||||
|
||||
* The ``django.db.models.query_utils.InvalidQuery`` exception class will be
|
||||
removed.
|
||||
|
||||
See the :ref:`Django 3.1 release notes <deprecated-features-3.1>` for more
|
||||
details on these changes.
|
||||
|
||||
|
||||
@@ -330,6 +330,11 @@ Miscellaneous
|
||||
* The undocumented usage of the :lookup:`isnull` lookup with non-boolean values
|
||||
as the right-hand side is deprecated, use ``True`` or ``False`` instead.
|
||||
|
||||
* The barely documented ``django.db.models.query_utils.InvalidQuery`` exception
|
||||
class is deprecated in favor of
|
||||
:class:`~django.core.exceptions.FieldDoesNotExist` and
|
||||
:class:`~django.core.exceptions.FieldError`.
|
||||
|
||||
.. _removed-features-3.1:
|
||||
|
||||
Features removed in 3.1
|
||||
|
||||
@@ -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
|
||||
------------------
|
||||
|
||||
Reference in New Issue
Block a user