mirror of
https://github.com/django/django.git
synced 2025-06-30 07:49:19 +00:00
[3.1.x] Fixed #31894 -- Added note about using JSONField key lookups with QuerySet.exclude() in docs.
Backport of 17407eca59b0572228067cdee51433f49a1e0adb from master
This commit is contained in:
parent
f36c441f80
commit
3fc636244e
@ -910,6 +910,14 @@ To query for missing keys, use the ``isnull`` lookup::
|
|||||||
:lookup:`istartswith`, :lookup:`lt`, :lookup:`lte`, :lookup:`gt`, and
|
:lookup:`istartswith`, :lookup:`lt`, :lookup:`lte`, :lookup:`gt`, and
|
||||||
:lookup:`gte`, as well as with :ref:`containment-and-key-lookups`.
|
:lookup:`gte`, as well as with :ref:`containment-and-key-lookups`.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
Due to the way in which key-path queries work,
|
||||||
|
:meth:`~django.db.models.query.QuerySet.exclude` and
|
||||||
|
:meth:`~django.db.models.query.QuerySet.filter` are not guaranteed to
|
||||||
|
produce exhaustive sets. If you want to include objects that do not have
|
||||||
|
the path, add the ``isnull`` lookup.
|
||||||
|
|
||||||
.. warning::
|
.. warning::
|
||||||
|
|
||||||
Since any string could be a key in a JSON object, any lookup other than
|
Since any string could be a key in a JSON object, any lookup other than
|
||||||
|
Loading…
x
Reference in New Issue
Block a user