djangodocs.org

743 sections across all versions Narrow to Django 6.0 (current) →

Database backend API

Release notes Django 1.11 release notes Backwards incompatible changes in 1.11

This section describes changes that may be needed in third-party database backends. The DatabaseOperations.time_trunc_sql() method is added to support TimeField truncation.

Release notes

Under certain circumstances, repeated iteration over querysets could leak memory - sometimes quite a bit of it. If you’d like more information, the details are in our ticket tracker (and in a related issue in Python itself).

Release notes Django 1.6 release notes Backwards incompatible changes in 1.6

Django 1.6 introduces hour, minute, and second lookups on DateTimeField. If you had model fields called hour, minute, or second, the new lookups will clash with you field names. Append an explicit exact lookup if this is an issue.

Models

Release notes Django 1.8 release notes What’s new in Django 1.8Minor features

There is now a model Meta option to define a default related name for all relational fields of a model. Pickling models and querysets across different versions of Django isn’t officially supported (it may work, but there’s no guarantee).

Bugfixes

Release notes Django 5.0.1 release notes

Fixed a regression in Django 5.0 where querysets referenced incorrect field names from FilteredRelation() (#35050). Fixed a regression in Django 5.0 that caused a system check crash when ModelAdmin.filter_horizontal or filter_vertical contained a reverse many-to-many relation with related_name (#35056).

5.0 5.1 5.2 6.0 dev

Bugfixes

Release notes Django 5.0.5 release notes

Fixed a bug in Django 5.0 that caused a migration crash when altering a GeneratedField referencing a renamed field (#35422). Fixed a bug in Django 5.0 where the querysets argument of GenericPrefetch was not required (#35426).

5.0 5.1 5.2 6.0 dev

Release notes Porting your apps from Django 0.96 to 1.0 Less-common changesDatabase backend functions

… | backend.allows_unique_and_pk | connection.features.allows_unique_and_pk | | backend.autoindexes_primary_keys | connection.features.autoindexes_primary_keys | | backend.needs_datetime_string_cast | connection.features.needs_datetime_string_cast | | backend.needs_upper_for_iops | connection.features.needs_upper_for_iops | | backend.supports_constraints | connection.features.supports_constraints | | backend.supports_tablespaces | connection.features.supports_tablespaces | | backend.uses_case_insensitive_names | connection.features.uses_case_insensitive_names | | backend.uses_custom_queryset | connection.features.uses_custom_queryset |

Bugfixes

Release notes Django 1.7.2 release notes

Fixed a regression where custom form fields having a queryset attribute but no limit_choices_to could not be used in a ModelForm (#23795). Fixed a custom field type validation error with MySQL backend when db_type returned None (#23761).

Bugfixes

Release notes Django 1.8.8 release notes

Made loaddata skip disabling and enabling database constraints when it doesn’t load any fixtures (#23372). Fixed a crash in QuerySet.values()/values_list() after an annotate() and order_by() when values()/values_list() includes a field not in the order_by() (#25316).

Bugfixes

Release notes Django 1.9.2 release notes

Fixed a crash when destroying an existing test database on MySQL or PostgreSQL (#26096). Fixed CSRF cookie check on POST requests when USE_X_FORWARDED_PORT=True (#26094). Fixed a QuerySet.order_by() crash when ordering by a relational field of a ManyToManyField through model (#26092).

Models

Release notes Django 2.1 release notes What’s new in Django 2.1Minor features

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 the future. The new QuerySet.explain() method displays the database’s execution plan of a queryset’s query.

Miscellaneous

Release notes Django 2.1 release notes Features deprecated in 2.1

QuerySet.raw() now caches its results like regular querysets. Use iterator() if you don’t want caching. The database router allow_relation() method is called in more cases. Improperly written routers may need to be updated accordingly.

Tests

Release notes Django 3.2 release notes What’s new in Django 3.2Minor features

TransactionTestCase.assertQuerysetEqual() now supports direct comparison against another queryset rather than being restricted to comparison against a list of string representations of objects when using the default value for the transform argument.

Miscellaneous

Release notes Django 4.1 release notes Features deprecated in 4.1

Use errors=[] instead. django.contrib.sessions.serializers.PickleSerializer is deprecated due to the risk of remote code execution. The usage of QuerySet.iterator() on a queryset that prefetches related objects without providing the chunk_size argument is deprecated. In older versions, no prefetching was done.

Miscellaneous

Release notes Django 5.0 release notes Features deprecated in 5.0

Filtering querysets against overflowing integer values now always returns an empty queryset. As a consequence, you may need to use ExpressionWrapper() to explicitly wrap arithmetic against integer fields in such cases.

5.0 5.1 5.2 6.0 dev

Miscellaneous

Release notes Django 5.1 release notes Features deprecated in 5.1

To improve performance, the delete_selected admin action now uses QuerySet.bulk_create() when creating multiple LogEntry objects. As a result, pre_save and post_save signals for LogEntry are not sent when multiple objects are deleted via this admin action.

5.1 5.2 6.0 dev

Miscellaneous

Release notes Django 6.2 release notes - UNDER DEVELOPMENT Features deprecated in 6.2

Omitting the argument is equivalent to the prior safe=False usage. Calling QuerySet.aiterator() after prefetch_related() without providing a chunk_size is deprecated. It currently falls back to a chunk_size of 2000, but a ValueError will be raised in Django 2029.

dev