From 247bcef6b4f8625e80b6f07e264b7bbdf330194d Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Tue, 28 Jul 2020 13:06:52 +0200 Subject: [3.1.x] Fixed #31836 -- Dropped support for JSONField __contains and __contained_by lookups on SQLite. The current implementation works only for basic examples without supporting nested structures and doesn't follow "the general principle that the contained object must match the containing object as to structure and data contents, possibly after discarding some non-matching array elements or object key/value pairs from the containing object". Backport of ba691933cee375195c9c50f333dd4b2a3abbb726 from master. --- docs/releases/3.1.txt | 5 ++++- docs/topics/db/queries.txt | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/releases/3.1.txt b/docs/releases/3.1.txt index cd74eb81cb..22e47c93ae 100644 --- a/docs/releases/3.1.txt +++ b/docs/releases/3.1.txt @@ -533,7 +533,10 @@ backends. ``DatabaseFeatures.supports_json_field`` to ``False``. If storing primitives is not supported, set ``DatabaseFeatures.supports_primitives_in_json_field`` to ``False``. If there is a true datatype for JSON, set - ``DatabaseFeatures.has_native_json_field`` to ``True``. + ``DatabaseFeatures.has_native_json_field`` to ``True``. If + :lookup:`jsonfield.contains` and :lookup:`jsonfield.contained_by` are not + supported, set ``DatabaseFeatures.supports_json_field_contains`` to + ``False``. * Third party database backends must implement introspection for ``JSONField`` or set ``can_introspect_json_field`` to ``False``. diff --git a/docs/topics/db/queries.txt b/docs/topics/db/queries.txt index 2528144d68..b3463cb4ce 100644 --- a/docs/topics/db/queries.txt +++ b/docs/topics/db/queries.txt @@ -960,9 +960,9 @@ contained in the top-level of the field. For example:: >>> Dog.objects.filter(data__contains={'breed': 'collie'}) ]> -.. admonition:: Oracle +.. admonition:: Oracle and SQLite - ``contains`` is not supported on Oracle. + ``contains`` is not supported on Oracle and SQLite. .. fieldlookup:: jsonfield.contained_by @@ -984,9 +984,9 @@ subset of those in the value passed. For example:: >>> Dog.objects.filter(data__contained_by={'breed': 'collie'}) ]> -.. admonition:: Oracle +.. admonition:: Oracle and SQLite - ``contained_by`` is not supported on Oracle. + ``contained_by`` is not supported on Oracle and SQLite. .. fieldlookup:: jsonfield.has_key -- cgit v1.3