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.
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).
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.
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).
Release notes
Django 5.1 release notes
What’s new in Django 5.1Minor features
QuerySet.explain() now supports the generic_plan option on PostgreSQL 16+. RowRange now accepts positive integers for the start argument and negative integers for the end argument.
5.1
5.2
6.0
dev
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.
Tutorial
Writing your first Django app, part 7
OK, we have our Question admin page, but a Question has multiple Choices, and the admin page doesn’t display choices. Yet. There are two ways to solve this problem.
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.
Topic guide
Making queries
Retrieving objectsLookups that span relationships
When spanning a ManyToManyField or a reverse ForeignKey (such as from Blog to Entry), filtering on multiple attributes raises the question of whether to require each attribute to coincide in the same related object.
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.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
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
Topic guide
Search
Use CasesDocument-based search
PostgreSQL has its own full text search implementation built-in. While not as powerful as some other search engines, it has the advantage of being inside your database and so can easily be combined with other relational queries such as categorization.
Reference
QuerySet API reference
QuerySet APIMethods that return new QuerySets
values(*fields,**expressions) Returns a QuerySet that returns dictionaries, rather than model instances, when used as an iterable. Each of those dictionaries represents an object, with the keys corresponding to the attribute names of model objects.
Reference
QuerySet API reference
QuerySet APIMethods that do not return QuerySets
update(**kwargs) aupdate(**kwargs) Asynchronous version: aupdate() Performs an SQL update query for the specified fields, and returns the number of rows matched (which may not be equal to the number of rows updated if some rows already have the new value).
5.1
5.2
6.0
dev
Topic guide
Models
Fields
Each field takes a certain set of field-specific arguments (documented in the model field reference). For example, CharField (and its subclasses) require a max_length argument which specifies the size of the VARCHAR database field used to store the data.
Topic guide
Models
FieldsRelationships
To define a many-to-many relationship, use ManyToManyField. You use it just like any other Field type: by including it as a class attribute of your model. ManyToManyField requires a positional argument: the class to which the model is related.
Index
| | | | --- | --- | | - cache - template tag - cache_control() (in module django.views.decorators.cache) - cache_key_prefix (backends.cached_db.SessionStore attribute) - CACHE_MIDDLEWARE_ALIAS - setting - CACHE_MIDDLEWARE_KEY_PREFIX - setting - CACHE_MIDDLEWARE_SECONDS - setting - cached.Loader (class in django.template.loaders) …
Release notes
Django 2.2.11 release notes
Fixed a data loss possibility in the select_for_update(). When using related fields or parent link fields with Multi-table inheritance in the of argument, the corresponding models were not locked (#31246).