mirror of
https://github.com/django/django.git
synced 2025-07-24 05:36:15 +00:00
[3.1.x] Fixed #31829 -- Used JSONField __contains lookup on key transforms.
Backport of 2d8dcba03a
from master
This commit is contained in:
parent
247bcef6b4
commit
23ce3d8491
3 changed files with 33 additions and 14 deletions
|
@ -905,10 +905,10 @@ To query for missing keys, use the ``isnull`` lookup::
|
|||
|
||||
The lookup examples given above implicitly use the :lookup:`exact` lookup.
|
||||
Key, index, and path transforms can also be chained with:
|
||||
:lookup:`contains`, :lookup:`icontains`, :lookup:`endswith`,
|
||||
:lookup:`iendswith`, :lookup:`iexact`, :lookup:`regex`, :lookup:`iregex`,
|
||||
:lookup:`startswith`, :lookup:`istartswith`, :lookup:`lt`, :lookup:`lte`,
|
||||
:lookup:`gt`, and :lookup:`gte` lookups.
|
||||
:lookup:`icontains`, :lookup:`endswith`, :lookup:`iendswith`,
|
||||
:lookup:`iexact`, :lookup:`regex`, :lookup:`iregex`, :lookup:`startswith`,
|
||||
:lookup:`istartswith`, :lookup:`lt`, :lookup:`lte`, :lookup:`gt`, and
|
||||
:lookup:`gte`, as well as with :ref:`containment-and-key-lookups`.
|
||||
|
||||
.. warning::
|
||||
|
||||
|
@ -937,8 +937,10 @@ To query for missing keys, use the ``isnull`` lookup::
|
|||
On PostgreSQL, if only one key or index is used, the SQL operator ``->`` is
|
||||
used. If multiple operators are used then the ``#>`` operator is used.
|
||||
|
||||
Containment and key operations
|
||||
------------------------------
|
||||
.. _containment-and-key-lookups:
|
||||
|
||||
Containment and key lookups
|
||||
---------------------------
|
||||
|
||||
.. fieldlookup:: jsonfield.contains
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue