... the admin ( #32080 ). Fixed a regression in Django 3.1 that caused a crash of ArrayAgg and StringAgg with ordering on key transforms for JSONField ( #32096 ). Fixed a regression in Django 3.1 that caused a crash of __in lookup when using key transforms fo ... ONField in the lookup value ( #32096 ). Fixed a regression in Django 3.1 that caused a crash of ExpressionWrapper with key transforms for JSONField ( #32096 ). Fixed a regression in Django 3.1 that caused a migrations crash on PostgreSQL when adding an Exc ... lusionConstraint with key transforms for JSONField in expressions ( #32096 ). Fixed a regression in Django 3.1 where ProtectedError.protected_objects and Restr ... ... equestFactory request methods ( #32159 ). Fixed crash of key transforms for JSONField on PostgreSQL when using on a Subquery() annotation ( #32182 ). Fixed a regression in Django 3.1 that caused ... s when JSONField is used on SQLite ( #32224 ). Fixed a crash on SQLite, when QuerySet.values()/values_list() contained key transforms for JSONField returning non-string primitive values ( #32203 ). ... ... ... Both fields support the use of custom JSON encoders and decoders. The model field supports the introspection, lookups, and transforms that were previously PostgreSQL-only: from django.db import models class ContactInfo ( models . Model ): data = models . J ... = "London" , ) . delete () If your project uses django.contrib.postgres.fields.JSONField , plus the related form field and transforms, you should adjust to use the new fields, and generate and apply a database migration. For now, the old fields and transfo ... es.fields.jsonb.KeyTransform and django.contrib.postgres.fields.jsonb.KeyTextTransform are also deprecated in favor of the transforms in django.db.models.fields.json . The new JSONField s, KeyTransform , and KeyTextTransform can be used on all supported da ... ... ddlewareMixin.process_request() and process_response() hooks when in an async context ( #31905 ). Fixed __in lookup on key transforms for JSONField with MariaDB, MySQL, Oracle, and SQLite ( #31936 ). Fixed a regression in Django 3.1 that caused permission ... ... . cursor () try : c . execute ( ... ) finally : c . close () Custom lookups It is now possible to write custom lookups and transforms for the ORM. Custom lookups work just like Django's built-in lookups (e.g. lte , icontains ) while transforms are a new co ... prior to the final lookup. For example it is possible to write a year transform that extracts year from the field's value. Transforms allow for chaining. After the year transform has been added to DateField it is possible to filter on the transformed value ... , for example qs.filter(author__birthdate__year__lte=1981) . For more information about both custom lookups and transforms refer to the custom lookups documentation. Improvements to Form error handling Form.add_error() Previously there were two ... ... ssions. Annotating a query with multiple Case expressions could unexpectedly filter out results ( #24924 ). Fixed usage of transforms in subqueries ( #24744 ). Fixed SimpleTestCase.assertRaisesMessage() on Python 2.7.10 ( #24903 ). Provided better backward ... ... headers argument or extra_headers attribute. Use the bcc argument instead. モデル The iexact=None lookup on JSONField key transforms now matches JSON null , to match the behavior of exact=None on key transforms. Previously, it was interpreted as an isnull ... ... gression in Django 5.2 that caused a crash when annotating aggregate expressions over query that uses explicit grouping by transforms followed by field references ( #36292 ). Fixed a regression in Django 5.2 that caused unnecessary queries when prefetching ... ... Query expressions can now be negated using a minus sign. QuerySet.order_by() and distinct(*fields) now support using field transforms. BooleanField can now be null=True . This is encouraged instead of NullBooleanField , which will likely be deprecated in t ... 2026年10月08日