Reference
Model instance reference
If you delete a field from a model instance, accessing it again reloads the value from the database: Model.refresh_from_db(using=None,fields=None,from_queryset=None)[source] Model.arefresh_from_db(using=None,fields=None,from_queryset=None) Asynchronous version: arefresh_from_db() If you need to reload a model’s values from the database, you can use the refresh_from_db() method.
5.1
5.2
Internals
Django Deprecation Timeline
ALLOWED_INCLUDE_ROOTS TEMPLATE_CONTEXT_PROCESSORS TEMPLATE_DEBUG TEMPLATE_DIRS TEMPLATE_LOADERS TEMPLATE_STRING_IF_INVALID The backwards compatibility alias django.template.loader.BaseLoader will be removed. Django template objects returned by get_template() and select_template() won’t accept a Context in their render() method anymore.
5.0
5.1
5.2
dev
Internals
Django Deprecation Timeline
ALLOWED_INCLUDE_ROOTS TEMPLATE_CONTEXT_PROCESSORS TEMPLATE_DEBUG TEMPLATE_DIRS TEMPLATE_LOADERS TEMPLATE_STRING_IF_INVALID The backwards compatibility alias django.template.loader.BaseLoader will be removed. Django template objects returned by get_template() and select_template() won’t accept a Context in their render() method anymore.
4.2
5.0
5.1
6.0
Index
… (OGRGeometry method) - get_list_display() (ModelAdmin method) - get_list_display_links() (ModelAdmin method) - get_list_filter() (ModelAdmin method) - get_list_or_404() (in module django.shortcuts) - get_list_select_related() (ModelAdmin method) - get_log_entries() (AdminSite method) - get_login_url() (AccessMixin method) - (LoginRequiredMiddleware method) - get_lookup() (in module django.db.models) - …
Index
… list_display_links (ModelAdmin attribute) - list_editable (ModelAdmin attribute) - list_filter (ModelAdmin attribute) - list_max_show_all (ModelAdmin attribute) - list_per_page (ModelAdmin attribute) - list_select_related (ModelAdmin attribute) - listdir() (Storage method) - lists() (QueryDict method) - ListView (built-in class) - LiveServerTestCase (class in django.test) …
Release notes
Django 1.10 release notes
Backwards incompatible changes in 1.10
Django 1.8 added validation for non-relational fields in select_related(): But it didn’t prohibit nested non-relation fields as it does now:
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:
Release notes
Django 1.5 release notes
Features deprecated in 1.5
The depth keyword argument in select_related() has been deprecated. You should use field names instead.
Release notes
Django 1.4 release notes
What’s new in Django 1.4
Similar to select_related() but with a different strategy and broader scope, prefetch_related() has been added to QuerySet.
Release notes
Django 1.7 release notes
What’s new in Django 1.7
This enables things like filtering prefetched relations, calling select_related() from a prefetched relation, or prefetching the same relation multiple times with different querysets. See prefetch_related() for more details.
Release notes
Django 6.1 release notes
Features deprecated in 6.1
Calling select_related() with no arguments to select all non-nullable related fields is deprecated. Specify the related fields to fetch instead, or use the FETCH_PEERS fetch mode. Setting ModelAdmin.list_select_related to True and returning True from ModelAdmin.get_list_select_related() are deprecated.
dev
Release notes
Django 5.2.2 release notes
Fixed a crash when using select_related against a ForeignObject originating from a model with a CompositePrimaryKey (#36373).
5.2
6.0
dev
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).
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).
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 …
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).
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.
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.
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.
Release notes
Django 6.1 release notes
Backwards incompatible changes in 6.1
choices=[("Group", [("1", "Item")]), ...]). When ModelAdmin.list_select_related is False (the default), the change list now selects only the foreign key fields specified in ModelAdmin.list_display, rather than all foreign key fields. This should improve performance for models with many foreign key fields.
dev