summaryrefslogtreecommitdiff
path: root/django/db/models/fields/json.py
AgeCommit message (Collapse)Author
2026-03-24Refs #36494 -- Prevented crash in JSONField numeric lookups with expressions.Vignesh Anand
2026-03-02Refs #35381 -- Moved JSONNull to django.db.models.expressions.Clifford Gama
2025-12-22Fixed #36508 -- Interpreted __iexact=None on KeyTransforms as __exact=None.Clifford Gama
Thanks Jacob Walls for the report.
2025-12-10Refs #36689 -- Serialized JSONIn rhs parameters wrapped in Value expressions.Clifford Gama
2025-12-10Fixed #36689 -- Fixed top-level JSONField __in lookup failures on MySQL and ↵Clifford Gama
Oracle. Added a JSONIn lookup to handle correct serialization and extraction for JSONField top-level __in queries on backends without native JSON support. KeyTransformIn now subclasses JSONIn. Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com> Thanks Jacob Walls for the report and review.
2025-11-12Refs #35381 -- Made JSONNull deconstruct using convenient import path.Clifford Gama
2025-10-29Refs #35381 -- Deprecated using None in JSONExact rhs to mean JSON null.Clifford Gama
Key and index lookups are exempt from the deprecation. Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
2025-10-29Fixed #35381 -- Added JSONNull() expression.Clifford Gama
Thanks Jacob Walls for the review.
2025-10-29Refs #35972 -- Returned params in a tuple in further lookups.Jacob Walls
2025-09-22Fixed #36612 -- Fixed a KeyTextTransform crash on MySQL against annotations.Simon Charette
MySQL only supports the ->> when used directly against columns, this can be inferred by the presence of lhs.output_field.model as model bounds fields are directly tied to columns. Purposely don't systematically switch to using JSON_QUOTE(JSON_EXTRACT(...)) as there might be functional indices out there that rely on the SQL remaining stable between versions. Thanks Jacob Tavener for the report.
2025-05-14Refs #36085 -- Moved compile_json_path to BaseDatabaseOperations.hesham942
2025-03-31Refs #28909 -- Simplified code using unpacking generalizations.Aarni Koskela
2025-02-18Fixed #35167 -- Delegated to super() in JSONField.get_db_prep_save().Jacob Walls
Avoids reports of bulk_update() sending Cast expressions to JSONField.get_prep_value(). Co-authored-by: Simon Charette <charette.s@gmail.com>
2024-12-04Fixed CVE-2024-53908 -- Prevented SQL injections in direct HasKeyLookup ↵Simon Charette
usage on Oracle. Thanks Seokchan Yoon for the report, and Mariusz Felisiak and Sarah Boyce for the reviews.
2024-12-03Refs #35842 -- Fixed handling of quotes in JSONField key lookups on Oracle.Sage Abdullah
2024-02-19Refs #34060 -- Fixed JSONField __exact lookup for primitivies on Oracle 21c+.Albert Defler
Regression in c991602ce5798385261381025c06698d7fd30dc5. Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2024-02-15Fixed #34060 -- Fixed migrations crash when adding check constraints with ↵Albert Defler
JSONField __exact lookup on Oracle.
2024-01-10Fixed #34769 -- Fixed key transforms on Oracle 21c+.Mariusz Felisiak
Oracle 21c introduced support for primivites in JSON fields that caused changes in handling them by JSON_QUERY/JSON_VALUE functions.
2023-09-18Refs #33308 -- Removed support for passing encoded JSON string literals to ↵Mariusz Felisiak
JSONField & co. Per deprecation timeline.
2023-05-16Fixed #34539 -- Restored get_prep_value() call when adapting JSONFields.Julie Rymer
Regression in 5c23d9f0c32f166c81ecb6f3f01d5077a6084318.
2022-12-01Refs #33308 -- Deprecated support for passing encoded JSON string literals ↵Simon Charette
to JSONField & co. JSON should be provided as literal Python objects an not in their encoded string literal forms.
2022-11-15Refs #33308 -- Used get_db_prep_value() to adapt JSONFields.Simon Charette
2022-10-31Used more augmented assignment statements.Nick Pope
Identified using the following command: $ git grep -I '\(\<[_a-zA-Z0-9]\+\>\) *= *\1 *[-+/*^%&|<>@]'
2022-09-16Fixed #33966 -- Added support for using KeyTextTransform from lookup.Allen Jonathan David
2022-08-18Refs #26511 -- Fixed json.KeyTextTransform() on MySQL/MariaDB.Mariusz Felisiak
2022-03-15Fixed #33552 -- Fixed JSONField has key lookups with numeric keys on ↵Sage Abdullah
MariaDB, MySQL, Oracle, and SQLite.
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2021-03-23Fixed #32483 -- Fixed QuerySet.values()/values_list() on JSONField key ↵Mariusz Felisiak
transforms with booleans on SQLite. Thanks Matthew Cornell for the report.
2021-02-05Fixed #32411 -- Fixed __icontains lookup for JSONField on MySQL.Hasan Ramezani
2020-12-11Fixed #32252 -- Fixed __isnull=True on key transforms on SQLite and Oracle.sage
__isnull=True on key transforms should not match keys with NULL values.
2020-12-07Removed lhs_only argument from KeyTransform.preprocess_lhs().sage
2020-11-25Fixed #32203 -- Fixed QuerySet.values()/values_list() crash on key ↵sage
transforms with non-string values on SQLite. Thanks Gordon Wrigley for the report.
2020-11-24Simplified JSONField key transforms by using JSON_OBJECT() on Oracle.Mariusz Felisiak
2020-11-10Fixed #32182 -- Fixed crash of JSONField nested key transforms with subquery ↵Hannes Ljungberg
annotations on PostgreSQL.
2020-10-15Refs #32096 -- Made JSONField check respect Meta.required_db_vendor.Mariusz Felisiak
Thanks Simon Charette for the implementation idea.
2020-10-14Refs #32096 -- Fixed __in lookup crash against key transforms for JSONField.Mariusz Felisiak
Regression in 6789ded0a6ab797f0dcdfa6ad5d1cfa46e23abcd and 1251772cb83aa4106f526fe00738e51c0eb59122. Thanks Simon Charette and Igor Jerosimić for the report.
2020-08-28Fixed #31956 -- Fixed crash of ordering by JSONField with a custom decoder ↵Mariusz Felisiak
on PostgreSQL. Thanks Marc Debureaux for the report. Thanks Simon Charette, Nick Pope, and Adam Johnson for reviews.
2020-08-26Fixed #31936 -- Fixed __in lookup on key transforms for JSONField.Mariusz Felisiak
This resolves an issue on databases without a native JSONField (MariaDB, MySQL, SQLite, Oracle), where values must be wrapped. Thanks Sébastien Pattyn for the report.
2020-07-28Fixed #31829 -- Used JSONField __contains lookup on key transforms.sage
2020-07-28Fixed #31836 -- Dropped support for JSONField __contains and __contained_by ↵Mariusz Felisiak
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".
2020-07-28Fixed #31835 -- Dropped support for JSONField __contains lookup on Oracle.Mariusz Felisiak
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".
2020-05-08Fixed #12990, Refs #27694 -- Added JSONField model field.sage
Thanks to Adam Johnson, Carlton Gibson, Mariusz Felisiak, and Raphael Michel for mentoring this Google Summer of Code 2019 project and everyone else who helped with the patch. Special thanks to Mads Jensen, Nick Pope, and Simon Charette for extensive reviews. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>