djangodocs.org

238 sections in Django 4.2 Search all versions →

Release notes Django 1.8 release notes Backwards incompatible changes in 1.8

select_related() now validates that the given fields actually exist. Previously, nonexistent fields were silently ignored. Now, an error is raised: The validation also makes sure that the given field is relational:

Bugfixes

Release notes Django 1.5.5 release notes

Fixed a Python 3 incompatibility in django.utils.text.unescape_entities() (#21185). Fixed a couple data corruption issues with QuerySet edge cases under Oracle and MySQL (#21203, #21126). Fixed crashes when using combinations of annotate(), select_related(), and only() (#16436).

Bugfixes

Release notes Django 1.6.7 release notes

Allowed inherited and m2m fields to be referenced in the admin (#23329). Fixed a crash when using QuerySet.defer() with select_related() (#23370).

Overview

Release notes Django 1.4 release notes

… ability to bulk insert large datasets for improved performance, and QuerySet.prefetch_related, a method to batch-load related objects in areas where select_related() doesn’t work. Some nice security additions, including improved password hashing (featuring PBKDF2 and bcrypt support), new tools for cryptographic …

Bugfixes

Release notes Django 1.6.5 release notes

Fixed the SQL generated when filtering by a negated Q object that contains a F object. (#22429). Avoided overwriting data fetched by select_related() in certain cases which could cause minor performance regressions (#22508).

Miscellaneous

Release notes Django 1.7 release notes Backwards incompatible changes in 1.7

select_related() now chains in the same way as other similar calls like prefetch_related. That is, select_related('foo', 'bar') is equivalent to select_related('foo').select_related('bar'). Previously the latter would have been equivalent to select_related('bar'). GeoDjango dropped support for GEOS < 3.1.

Features removed in 1.7

Release notes Django 1.7 release notes

select_related() no longer has a depth keyword argument. The get_warnings_state()/restore_warnings_state() functions from django.test.utils and the save_warnings_state()/ restore_warnings_state() django.test.*TestCase are removed. The check_for_test_cookie method in AuthenticationForm is removed. The version of django.contrib.auth.views.password_reset_confirm() that supports base36 encoded user IDs (django.contrib.auth.views.password_reset_confirm_uidb36) is removed.

django.contrib.admin

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

ModelAdmin.get_list_select_related() was added to allow changing the select_related() values used in the admin’s changelist query based on the request. The available_apps context variable, which lists the available applications for the current user, has been added to the AdminSite.each_context() method.

Miscellaneous

Release notes Django 1.5 release notes Backwards incompatible changes in 1.5

BoundField.label_tag now escapes its contents argument. To avoid the HTML escaping, use django.utils.safestring.mark_safe() on the argument before passing it. Accessing reverse one-to-one relations fetched via select_related() now raises DoesNotExist instead of returning None.

Minor features

Release notes Django 1.6 release notes What’s new in Django 1.6

The list of related fields added to a QuerySet by select_related() can be cleared using select_related(None). The get_extra() and get_max_num() methods on InlineModelAdmin may be overridden to customize the extra and maximum number of inline forms.

Release notes

Added missing items to django.utils.timezone.__all__ (#21880). Fixed a field misalignment issue with select_related() and model inheritance (#21413). Fixed join promotion for negated AND conditions (#21748). Oracle database introspection now works with boolean and float fields (#19884).

Models

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

It may be helpful particularly when select_for_update() is used in conjunction with select_related(). The new field_name parameter of QuerySet.in_bulk() allows fetching results based on any unique model field.

Bugfixes

Release notes Django 4.2.2 release notes

Fixed a regression in Django 4.2 that caused a serialization crash on a ManyToManyField without a natural key when its Manager’s base QuerySet used select_related() (#34620).

ModelAdmin options

Reference The Django admin site ModelAdmin objects

ModelAdmin.autocomplete_fields : autocomplete_fields is a list of ForeignKey and/or ManyToManyField fields you would like to change to Select2 autocomplete inputs. ModelAdmin.raw_id_fields : By default, Django’s admin uses a select-box interface (<select>) for fields that are ForeignKey.

InlineModelAdmin options

Reference The Django admin site InlineModelAdmin objects

InlineModelAdmin.max_num : This controls the maximum number of forms to show in the inline. This doesn’t directly correlate to the number of objects, but can if the value is small enough.

distinct()

Reference QuerySet API reference QuerySet APIMethods that return new QuerySets

distinct(*fields) Returns a new QuerySet that uses SELECT DISTINCT in its SQL query. This eliminates duplicate rows from the query results. By default, a QuerySet will not eliminate duplicate rows.