mirror of
https://github.com/django/django.git
synced 2024-11-21 19:09:18 +01:00
Removed versionadded/changed annotations for 5.0.
This also removes remaining versionadded/changed annotations for older versions.
This commit is contained in:
parent
ec44247f59
commit
05cce083ad
@ -192,10 +192,6 @@ filtered out of error reports in a production environment (that is, where
|
||||
@another_decorator
|
||||
def process_info(user): ...
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for wrapping ``async`` functions was added.
|
||||
|
||||
.. function:: sensitive_post_parameters(*parameters)
|
||||
|
||||
If one of your views receives an :class:`~django.http.HttpRequest` object
|
||||
@ -235,10 +231,6 @@ filtered out of error reports in a production environment (that is, where
|
||||
``user_change_password`` in the ``auth`` admin) to prevent the leaking of
|
||||
sensitive information such as user passwords.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for wrapping ``async`` functions was added.
|
||||
|
||||
.. _custom-error-reports:
|
||||
|
||||
Custom error reports
|
||||
|
@ -431,11 +431,6 @@ application registry.
|
||||
It must be called explicitly in other cases, for instance in plain Python
|
||||
scripts.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Raises a ``RuntimeWarning`` when apps interact with the database before
|
||||
the app registry has been fully populated.
|
||||
|
||||
.. currentmodule:: django.apps
|
||||
|
||||
The application registry is initialized in three stages. At each stage, Django
|
||||
|
@ -90,11 +90,6 @@ that tells the middleware not to set the header::
|
||||
iframe, you may need to modify the :setting:`CSRF_COOKIE_SAMESITE` or
|
||||
:setting:`SESSION_COOKIE_SAMESITE` settings.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for wrapping asynchronous view functions was added to the
|
||||
``@xframe_options_exempt`` decorator.
|
||||
|
||||
Setting ``X-Frame-Options`` per view
|
||||
------------------------------------
|
||||
|
||||
@ -118,11 +113,6 @@ decorators::
|
||||
Note that you can use the decorators in conjunction with the middleware. Use of
|
||||
a decorator overrides the middleware.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for wrapping asynchronous view functions was added to the
|
||||
``@xframe_options_deny`` and ``@xframe_options_sameorigin`` decorators.
|
||||
|
||||
Limitations
|
||||
===========
|
||||
|
||||
|
@ -216,8 +216,6 @@ concrete example.
|
||||
Facets
|
||||
======
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
By default, counts for each filter, known as facets, can be shown by toggling
|
||||
on via the admin UI. These counts will update according to the currently
|
||||
applied filters. See :attr:`ModelAdmin.show_facets` for more details.
|
||||
|
@ -839,10 +839,6 @@ subclass::
|
||||
|
||||
full_name = property(my_property)
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for ``boolean`` attribute on properties was added.
|
||||
|
||||
* The field names in ``list_display`` will also appear as CSS classes in
|
||||
the HTML output, in the form of ``column-<field_name>`` on each ``<th>``
|
||||
element. This can be used to set column widths in a CSS file for example.
|
||||
@ -1028,8 +1024,6 @@ subclass::
|
||||
|
||||
.. attribute:: ModelAdmin.show_facets
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
Controls whether facet counts are displayed for filters in the admin
|
||||
changelist. Defaults to :attr:`.ShowFacets.ALLOW`.
|
||||
|
||||
@ -1037,8 +1031,6 @@ subclass::
|
||||
|
||||
.. class:: ShowFacets
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
Enum of allowed values for :attr:`.ModelAdmin.show_facets`.
|
||||
|
||||
.. attribute:: ALWAYS
|
||||
@ -1895,10 +1887,6 @@ templates used by the :class:`ModelAdmin` views:
|
||||
Override this method to customize the lookups permitted for your
|
||||
:class:`~django.contrib.admin.ModelAdmin` subclass.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
The ``request`` argument was added.
|
||||
|
||||
.. method:: ModelAdmin.has_view_permission(request, obj=None)
|
||||
|
||||
Should return ``True`` if viewing ``obj`` is permitted, ``False`` otherwise.
|
||||
@ -2160,10 +2148,6 @@ forms or widgets depending on ``django.jQuery`` must specify
|
||||
``js=['admin/js/jquery.init.js', …]`` when :ref:`declaring form media assets
|
||||
<assets-as-a-static-definition>`.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
jQuery was upgraded from 3.6.4 to 3.7.1.
|
||||
|
||||
The :class:`ModelAdmin` class requires jQuery by default, so there is no need
|
||||
to add jQuery to your ``ModelAdmin``’s list of media resources unless you have
|
||||
a specific need. For example, if you require the jQuery library to be in the
|
||||
@ -2879,10 +2863,6 @@ Templates can override or extend base admin templates as described in
|
||||
The text to put at the top of each admin page, as a ``<div>`` (a string).
|
||||
By default, this is "Django administration".
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
In older versions, ``site_header`` was using an ``<h1>`` tag.
|
||||
|
||||
.. attribute:: AdminSite.site_title
|
||||
|
||||
The text to put at the end of each admin page's ``<title>`` (a string). By
|
||||
@ -3054,15 +3034,11 @@ Templates can override or extend base admin templates as described in
|
||||
|
||||
.. method:: AdminSite.get_model_admin(model)
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
Returns an admin class for the given model class. Raises
|
||||
``django.contrib.admin.exceptions.NotRegistered`` if a model isn't registered.
|
||||
|
||||
.. method:: AdminSite.get_log_entries(request)
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
Returns a queryset for the related
|
||||
:class:`~django.contrib.admin.models.LogEntry` instances, shown on the site
|
||||
index page. This method can be overridden to filter the log entries by
|
||||
|
@ -173,10 +173,6 @@ Methods
|
||||
the user. (This takes care of the password hashing in making the
|
||||
comparison.)
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
``acheck_password()`` method was added.
|
||||
|
||||
.. method:: set_unusable_password()
|
||||
|
||||
Marks the user as having no password set. This isn't the same as
|
||||
@ -721,6 +717,3 @@ Utility functions
|
||||
backend's ``get_user()`` method, or if the session auth hash doesn't
|
||||
validate.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
``aget_user()`` function was added.
|
||||
|
@ -601,8 +601,6 @@ information.
|
||||
``GenericPrefetch()``
|
||||
---------------------
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
.. class:: GenericPrefetch(lookup, querysets, to_attr=None)
|
||||
|
||||
This lookup is similar to ``Prefetch()`` and it should only be used on
|
||||
|
@ -257,8 +257,6 @@ value of the geometry.
|
||||
``ClosestPoint``
|
||||
================
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
.. class:: ClosestPoint(expr1, expr2, **extra)
|
||||
|
||||
*Availability*: `PostGIS <https://postgis.net/docs/ST_ClosestPoint.html>`__,
|
||||
|
@ -879,10 +879,6 @@ aggregate, except it can be several orders of magnitude faster than performing
|
||||
a union because it rolls up geometries into a collection or multi object, not
|
||||
caring about dissolving boundaries.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for using the ``filter`` argument was added.
|
||||
|
||||
.. versionchanged:: 5.1
|
||||
|
||||
MySQL 8.0.24+ support was added.
|
||||
@ -906,10 +902,6 @@ Example:
|
||||
>>> print(qs["poly__extent"])
|
||||
(-96.8016128540039, 29.7633724212646, -95.3631439208984, 32.782058715820)
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for using the ``filter`` argument was added.
|
||||
|
||||
``Extent3D``
|
||||
~~~~~~~~~~~~
|
||||
|
||||
@ -929,10 +921,6 @@ Example:
|
||||
>>> print(qs["poly__extent3d"])
|
||||
(-96.8016128540039, 29.7633724212646, 0, -95.3631439208984, 32.782058715820, 0)
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for using the ``filter`` argument was added.
|
||||
|
||||
``MakeLine``
|
||||
~~~~~~~~~~~~
|
||||
|
||||
@ -952,10 +940,6 @@ Example:
|
||||
>>> print(qs["poly__makeline"])
|
||||
LINESTRING (-95.3631510000000020 29.7633739999999989, -96.8016109999999941 32.7820570000000018)
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for using the ``filter`` argument was added.
|
||||
|
||||
``Union``
|
||||
~~~~~~~~~
|
||||
|
||||
@ -983,10 +967,6 @@ Example:
|
||||
... Union(poly)
|
||||
... ) # A more sensible approach.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for using the ``filter`` argument was added.
|
||||
|
||||
.. rubric:: Footnotes
|
||||
.. [#fnde9im] *See* `OpenGIS Simple Feature Specification For SQL <https://portal.ogc.org/files/?artifact_id=829>`_, at Ch. 2.1.13.2, p. 2-13 (The Dimensionally Extended Nine-Intersection Model).
|
||||
.. [#fnsdorelate] *See* `SDO_RELATE documentation <https://docs.oracle.com/en/
|
||||
|
@ -484,8 +484,6 @@ return a boolean.
|
||||
|
||||
.. method:: GEOSGeometry.equals_identical(other)
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
Returns ``True`` if the two geometries are point-wise equivalent by
|
||||
checking that the structure, ordering, and values of all vertices are
|
||||
identical in all dimensions. ``NaN`` values are considered to be equal to
|
||||
|
@ -456,8 +456,6 @@ the session cookie settings:
|
||||
Testing
|
||||
=======
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
This module offers a tailored test assertion method, for testing messages
|
||||
attached to an :class:`~.HttpResponse`.
|
||||
|
||||
|
@ -55,12 +55,6 @@ General-purpose aggregation functions
|
||||
|
||||
F("some_field").desc()
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
In older versions, if there are no rows and ``default`` is not
|
||||
provided, ``ArrayAgg`` returned an empty list instead of ``None``. If
|
||||
you need it, explicitly set ``default`` to ``Value([])``.
|
||||
|
||||
``BitAnd``
|
||||
----------
|
||||
|
||||
@ -182,12 +176,6 @@ General-purpose aggregation functions
|
||||
{'parking': True, 'double_bed': True}
|
||||
]}]>
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
In older versions, if there are no rows and ``default`` is not
|
||||
provided, ``JSONBAgg`` returned an empty list instead of ``None``. If
|
||||
you need it, explicitly set ``default`` to ``Value([])``.
|
||||
|
||||
``StringAgg``
|
||||
-------------
|
||||
|
||||
@ -243,12 +231,6 @@ General-purpose aggregation functions
|
||||
'headline': 'NASA uses Python', 'publication_names': 'Science News, The Python Journal'
|
||||
}]>
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
In older versions, if there are no rows and ``default`` is not
|
||||
provided, ``StringAgg`` returned an empty string instead of ``None``.
|
||||
If you need it, explicitly set ``default`` to ``Value("")``.
|
||||
|
||||
Aggregate functions for statistics
|
||||
==================================
|
||||
|
||||
|
@ -136,8 +136,6 @@ used for queries that select only included fields
|
||||
``violation_error_code``
|
||||
------------------------
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
.. attribute:: ExclusionConstraint.violation_error_code
|
||||
|
||||
The error code used when ``ValidationError`` is raised during
|
||||
|
@ -249,11 +249,6 @@ Note:
|
||||
sitemap was requested is used. If the sitemap is built outside the
|
||||
context of a request, the default is ``'https'``.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
In older versions, the default protocol for sitemaps built outside
|
||||
the context of a request was ``'http'``.
|
||||
|
||||
.. attribute:: Sitemap.limit
|
||||
|
||||
**Optional.**
|
||||
|
@ -150,10 +150,6 @@ class-based views<decorating-class-based-views>`.
|
||||
def my_view(request):
|
||||
return HttpResponse("Hello world")
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for wrapping asynchronous view functions was added.
|
||||
|
||||
.. function:: csrf_protect(view)
|
||||
|
||||
Decorator that provides the protection of ``CsrfViewMiddleware`` to a view.
|
||||
@ -170,10 +166,6 @@ class-based views<decorating-class-based-views>`.
|
||||
# ...
|
||||
return render(request, "a_template.html", c)
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for wrapping asynchronous view functions was added.
|
||||
|
||||
.. function:: requires_csrf_token(view)
|
||||
|
||||
Normally the :ttag:`csrf_token` template tag will not work if
|
||||
@ -194,18 +186,10 @@ class-based views<decorating-class-based-views>`.
|
||||
# ...
|
||||
return render(request, "a_template.html", c)
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for wrapping asynchronous view functions was added.
|
||||
|
||||
.. function:: ensure_csrf_cookie(view)
|
||||
|
||||
This decorator forces a view to send the CSRF cookie.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for wrapping asynchronous view functions was added.
|
||||
|
||||
Settings
|
||||
========
|
||||
|
||||
|
@ -1554,8 +1554,6 @@ Outputs timings, including database setup and total run time.
|
||||
|
||||
.. django-admin-option:: --durations N
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
Shows the N slowest test cases (N=0 for all).
|
||||
|
||||
.. admonition:: Python 3.12 and later
|
||||
|
@ -59,10 +59,6 @@ The ``File`` class
|
||||
|
||||
It can be used as a context manager, e.g. ``with file.open() as f:``.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for passing ``*args`` and ``**kwargs`` was added.
|
||||
|
||||
.. method:: __iter__()
|
||||
|
||||
Iterate over the file yielding one line at a time.
|
||||
|
@ -1192,10 +1192,6 @@ Attributes of ``BoundField``
|
||||
When rendering a field with errors, ``aria-invalid="true"`` will be set on
|
||||
the field's widget to indicate there is an error to screen reader users.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
The ``aria-invalid="true"`` was added when a field has errors.
|
||||
|
||||
.. attribute:: BoundField.field
|
||||
|
||||
The form :class:`~django.forms.Field` instance from the form class that
|
||||
@ -1289,8 +1285,6 @@ Attributes of ``BoundField``
|
||||
|
||||
.. attribute:: BoundField.template_name
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
The name of the template rendered with :meth:`.BoundField.as_field_group`.
|
||||
|
||||
A property returning the value of the
|
||||
@ -1323,8 +1317,6 @@ Methods of ``BoundField``
|
||||
|
||||
.. method:: BoundField.as_field_group()
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
Renders the field using :meth:`.BoundField.render` with default values
|
||||
which renders the ``BoundField``, including its label, help text and errors
|
||||
using the template's :attr:`~django.forms.Field.template_name` if set
|
||||
@ -1372,8 +1364,6 @@ Methods of ``BoundField``
|
||||
|
||||
.. method:: BoundField.get_context()
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
Return the template context for rendering the field. The available context
|
||||
is ``field`` being the instance of the bound field.
|
||||
|
||||
@ -1426,8 +1416,6 @@ Methods of ``BoundField``
|
||||
|
||||
.. method:: BoundField.render(template_name=None, context=None, renderer=None)
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
The render method is called by ``as_field_group``. All arguments are
|
||||
optional and default to:
|
||||
|
||||
|
@ -322,10 +322,6 @@ inside ``aria-describedby``:
|
||||
>>> print(f["username"])
|
||||
<input type="text" name="username" aria-describedby="custom-description id_username_helptext" maxlength="255" id="id_username" required>
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
``aria-describedby`` was added to associate ``help_text`` with its input.
|
||||
|
||||
.. versionchanged:: 5.1
|
||||
|
||||
``aria-describedby`` support was added for ``<fieldset>``.
|
||||
@ -397,8 +393,6 @@ be ignored in favor of the value from the form's initial data.
|
||||
|
||||
.. attribute:: Field.template_name
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
The ``template_name`` argument allows a custom template to be used when the
|
||||
field is rendered with :meth:`~django.forms.BoundField.as_field_group`. By
|
||||
default this value is set to ``"django/forms/field.html"``. Can be changed per
|
||||
@ -513,12 +507,6 @@ For each field, we describe the default widget used if you don't specify
|
||||
other data types, such as integers or booleans, consider using
|
||||
:class:`TypedChoiceField` instead.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for mappings and using
|
||||
:ref:`enumeration types <field-choices-enum-types>` directly in
|
||||
``choices`` was added.
|
||||
|
||||
``DateField``
|
||||
-------------
|
||||
|
||||
@ -1145,8 +1133,6 @@ For each field, we describe the default widget used if you don't specify
|
||||
|
||||
.. attribute:: assume_scheme
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
The scheme assumed for URLs provided without one. Defaults to
|
||||
``"http"``. For example, if ``assume_scheme`` is ``"https"`` and the
|
||||
provided value is ``"example.com"``, the normalized value will be
|
||||
|
@ -61,8 +61,6 @@ should return a rendered templates (as a string) or raise
|
||||
|
||||
.. attribute:: field_template_name
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
The default name of the template used to render a ``BoundField``.
|
||||
|
||||
Defaults to ``"django/forms/field.html"``
|
||||
@ -173,8 +171,6 @@ forms receive a dictionary with the following values:
|
||||
Context available in field templates
|
||||
====================================
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
Field templates receive a context from :meth:`.BoundField.get_context`. By
|
||||
default, fields receive a dictionary with the following values:
|
||||
|
||||
@ -224,8 +220,6 @@ renderer. Then overriding form templates works :doc:`the same as
|
||||
Overriding built-in field templates
|
||||
===================================
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
:attr:`.Field.template_name`
|
||||
|
||||
To override field templates, you must use the :class:`TemplatesSetting`
|
||||
|
@ -60,8 +60,6 @@ constraint.
|
||||
``violation_error_code``
|
||||
------------------------
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
.. attribute:: BaseConstraint.violation_error_code
|
||||
|
||||
The error code used when ``ValidationError`` is raised during
|
||||
@ -263,8 +261,6 @@ creates a unique index on ``username`` using ``varchar_pattern_ops``.
|
||||
``nulls_distinct``
|
||||
------------------
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
.. attribute:: UniqueConstraint.nulls_distinct
|
||||
|
||||
Whether rows containing ``NULL`` values covered by the unique constraint should
|
||||
@ -284,8 +280,6 @@ PostgreSQL 15+.
|
||||
``violation_error_code``
|
||||
------------------------
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
.. attribute:: UniqueConstraint.violation_error_code
|
||||
|
||||
The error code used when ``ValidationError`` is raised during
|
||||
|
@ -569,11 +569,6 @@ Usage example:
|
||||
On Oracle, the SQL ``LOCALTIMESTAMP`` is used to avoid issues with casting
|
||||
``CURRENT_TIMESTAMP`` to ``DateTimeField``.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
In older versions, the SQL ``CURRENT_TIMESTAMP`` was used on Oracle instead
|
||||
of ``LOCALTIMESTAMP``.
|
||||
|
||||
``Trunc``
|
||||
---------
|
||||
|
||||
|
@ -1053,8 +1053,6 @@ calling the appropriate methods on the wrapped expression.
|
||||
|
||||
.. attribute:: allowed_default
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
Tells Django that this expression can be used in
|
||||
:attr:`Field.db_default`. Defaults to ``False``.
|
||||
|
||||
|
@ -138,10 +138,6 @@ the choices are:
|
||||
provide a well-known inventory of values, such as currencies, countries,
|
||||
languages, time zones, etc.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for mappings and callables was added.
|
||||
|
||||
Generally, it's best to define choices inside a model class, and to
|
||||
define a suitably-named constant for each value::
|
||||
|
||||
@ -372,10 +368,6 @@ There are some additional caveats to be aware of:
|
||||
|
||||
__empty__ = _("(Unknown)")
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for using enumeration types directly in the ``choices`` was added.
|
||||
|
||||
``db_column``
|
||||
-------------
|
||||
|
||||
@ -405,8 +397,6 @@ looking at your Django code. For example::
|
||||
``db_default``
|
||||
--------------
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
.. attribute:: Field.db_default
|
||||
|
||||
The database-computed default value for this field. This can be a literal value
|
||||
@ -1235,8 +1225,6 @@ when :attr:`~django.forms.Field.localize` is ``False`` or
|
||||
``GeneratedField``
|
||||
------------------
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
.. class:: GeneratedField(expression, output_field, db_persist=None, **kwargs)
|
||||
|
||||
A field that is always computed based on other fields in the model. This field
|
||||
|
@ -580,10 +580,6 @@ which returns ``NULL``. In such cases it is possible to revert to the old
|
||||
algorithm by setting the :attr:`~django.db.models.Options.select_on_save`
|
||||
option to ``True``.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
The ``Field.db_default`` parameter was added.
|
||||
|
||||
.. _ref-models-force-insert:
|
||||
|
||||
Forcing an INSERT or UPDATE
|
||||
@ -616,11 +612,6 @@ only.
|
||||
|
||||
Using ``update_fields`` will force an update similarly to ``force_update``.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for passing a tuple of parent classes to ``force_insert`` was
|
||||
added.
|
||||
|
||||
.. _ref-models-field-updates-using-f-expressions:
|
||||
|
||||
Updating attributes based on existing fields
|
||||
|
@ -1160,12 +1160,6 @@ supports prefetching of
|
||||
queryset for each ``ContentType`` must be provided in the ``querysets``
|
||||
parameter of :class:`~django.contrib.contenttypes.prefetch.GenericPrefetch`.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for prefetching
|
||||
:class:`~django.contrib.contenttypes.fields.GenericForeignKey` with
|
||||
non-homogeneous set of results was added.
|
||||
|
||||
For example, suppose you have these models::
|
||||
|
||||
from django.db import models
|
||||
@ -2114,13 +2108,6 @@ SQL equivalent:
|
||||
2
|
||||
)
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
In older versions, on databases without native support for the SQL
|
||||
``XOR`` operator, ``XOR`` returned rows that were matched by exactly
|
||||
one operand. The previous behavior was not consistent with MySQL,
|
||||
MariaDB, and Python behavior.
|
||||
|
||||
Methods that do not return ``QuerySet``\s
|
||||
-----------------------------------------
|
||||
|
||||
@ -2402,10 +2389,6 @@ Like :meth:`get_or_create` and :meth:`create`, if you're using manually
|
||||
specified primary keys and an object needs to be created but the key already
|
||||
exists in the database, an :exc:`~django.db.IntegrityError` is raised.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
The ``create_defaults`` argument was added.
|
||||
|
||||
``bulk_create()``
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
@ -2470,11 +2453,6 @@ be in conflict must be provided.
|
||||
Enabling the ``ignore_conflicts`` parameter disables setting the primary key on
|
||||
each model instance (if the database normally supports it).
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
In older versions, enabling the ``update_conflicts`` parameter prevented
|
||||
setting the primary key on each model instance.
|
||||
|
||||
.. warning::
|
||||
|
||||
On MySQL and MariaDB, setting the ``ignore_conflicts`` parameter to
|
||||
@ -2629,11 +2607,6 @@ evaluated will force it to evaluate again, repeating the query.
|
||||
long as ``chunk_size`` is given. Larger values will necessitate fewer queries
|
||||
to accomplish the prefetching at the cost of greater memory usage.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for ``aiterator()`` with previous calls to ``prefetch_related()``
|
||||
was added.
|
||||
|
||||
On some databases (e.g. Oracle, `SQLite
|
||||
<https://www.sqlite.org/limits.html#max_variable_number>`_), the maximum number
|
||||
of terms in an SQL ``IN`` clause might be limited. Hence values below this
|
||||
@ -4162,10 +4135,6 @@ When using multiple databases with ``prefetch_related_objects``, the prefetch
|
||||
query will use the database associated with the model instance. This can be
|
||||
overridden by using a custom queryset in a related lookup.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
``aprefetch_related_objects()`` function was added.
|
||||
|
||||
``FilteredRelation()`` objects
|
||||
------------------------------
|
||||
|
||||
|
@ -58,8 +58,6 @@ For examples, see the :doc:`Pagination topic guide </topics/pagination>`.
|
||||
|
||||
.. attribute:: Paginator.error_messages
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
The ``error_messages`` argument lets you override the default messages that
|
||||
the paginator will raise. Pass in a dictionary with keys matching the error
|
||||
messages you want to override. Available error message keys are:
|
||||
|
@ -289,8 +289,6 @@ Methods
|
||||
|
||||
.. method:: HttpRequest.auser()
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
From the :class:`~django.contrib.auth.middleware.AuthenticationMiddleware`:
|
||||
Coroutine. Returns an instance of :setting:`AUTH_USER_MODEL` representing
|
||||
the currently logged-in user. If the user isn't currently logged in,
|
||||
@ -1290,8 +1288,6 @@ Attributes
|
||||
Handling disconnects
|
||||
--------------------
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
If the client disconnects during a streaming response, Django will cancel the
|
||||
coroutine that is handling the response. If you want to clean up resources
|
||||
manually, you can do so by catching the ``asyncio.CancelledError``::
|
||||
|
@ -1689,7 +1689,6 @@ renderers are:
|
||||
``FORMS_URLFIELD_ASSUME_HTTPS``
|
||||
-------------------------------
|
||||
|
||||
.. versionadded:: 5.0
|
||||
.. deprecated:: 5.0
|
||||
|
||||
Default: ``False``
|
||||
@ -2923,10 +2922,6 @@ be retained if present.
|
||||
|
||||
See also :setting:`TIME_ZONE` and :setting:`USE_I18N`.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
In older versions, the default value is ``False``.
|
||||
|
||||
.. setting:: USE_X_FORWARDED_HOST
|
||||
|
||||
``USE_X_FORWARDED_HOST``
|
||||
|
@ -1957,8 +1957,6 @@ For example:
|
||||
``escapeseq``
|
||||
-------------
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
Applies the :tfilter:`escape` filter to each element of a sequence. Useful in
|
||||
conjunction with other filters that operate on sequences, such as
|
||||
:tfilter:`join`. For example:
|
||||
@ -2726,10 +2724,6 @@ Newlines in the HTML content will be preserved.
|
||||
resource-intensive and impact service performance. ``truncatechars_html``
|
||||
limits input to the first five million characters.
|
||||
|
||||
.. versionchanged:: 3.2.22
|
||||
|
||||
In older versions, strings over five million characters were processed.
|
||||
|
||||
.. templatefilter:: truncatewords
|
||||
|
||||
``truncatewords``
|
||||
@ -2778,10 +2772,6 @@ Newlines in the HTML content will be preserved.
|
||||
resource-intensive and impact service performance. ``truncatewords_html``
|
||||
limits input to the first five million characters.
|
||||
|
||||
.. versionchanged:: 3.2.22
|
||||
|
||||
In older versions, strings over five million characters were processed.
|
||||
|
||||
.. templatefilter:: unordered_list
|
||||
|
||||
``unordered_list``
|
||||
|
@ -395,6 +395,3 @@ to, or in lieu of custom ``field.clean()`` methods.
|
||||
``StepValueValidator(3, offset=1.4)`` valid values include ``1.4``,
|
||||
``4.4``, ``7.4``, ``10.4``, and so on.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
The ``offset`` argument was added.
|
||||
|
@ -76,8 +76,6 @@ corruption.
|
||||
Decorators
|
||||
----------
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
The following decorators can be used with both synchronous and asynchronous
|
||||
view functions:
|
||||
|
||||
@ -181,8 +179,6 @@ mode if you have asynchronous code in your project.
|
||||
Handling disconnects
|
||||
--------------------
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
For long-lived requests, a client may disconnect before the view returns a
|
||||
response. In this case, an ``asyncio.CancelledError`` will be raised in the
|
||||
view. You can catch this error and handle it if you need to perform any
|
||||
|
@ -703,10 +703,6 @@ The following attributes and methods are available on any subclass of
|
||||
the user. (This takes care of the password hashing in making the
|
||||
comparison.)
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
``acheck_password()`` method was added.
|
||||
|
||||
.. method:: models.AbstractBaseUser.set_unusable_password()
|
||||
|
||||
Marks the user as having no password set. This isn't the same as
|
||||
|
@ -155,10 +155,6 @@ Authenticating users
|
||||
this. Rather if you're looking for a way to login a user, use the
|
||||
:class:`~django.contrib.auth.views.LoginView`.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
``aauthenticate()`` function was added.
|
||||
|
||||
.. _topic-authorization:
|
||||
|
||||
Permissions and Authorization
|
||||
@ -401,10 +397,6 @@ Or in an asynchronous view::
|
||||
# Do something for anonymous users.
|
||||
...
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
The :meth:`.HttpRequest.auser` method was added.
|
||||
|
||||
.. _how-to-log-a-user-in:
|
||||
|
||||
How to log a user in
|
||||
@ -446,10 +438,6 @@ If you have an authenticated user you want to attach to the current session
|
||||
# Return an 'invalid login' error message.
|
||||
...
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
``alogin()`` function was added.
|
||||
|
||||
Selecting the authentication backend
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@ -505,10 +493,6 @@ How to log a user out
|
||||
immediately after logging out, do that *after* calling
|
||||
:func:`django.contrib.auth.logout()`.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
``alogout()`` function was added.
|
||||
|
||||
Limiting access to logged-in users
|
||||
----------------------------------
|
||||
|
||||
@ -1000,10 +984,6 @@ function.
|
||||
else:
|
||||
...
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
``aupdate_session_auth_hash()`` function was added.
|
||||
|
||||
.. note::
|
||||
|
||||
Since
|
||||
|
@ -493,10 +493,6 @@ from the ``User`` model.
|
||||
to use the default (first entry of ``PASSWORD_HASHERS`` setting). See
|
||||
:ref:`auth-included-hashers` for the algorithm name of each hasher.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
``acheck_password()`` method was added.
|
||||
|
||||
.. function:: make_password(password, salt=None, hasher='default')
|
||||
|
||||
Creates a hashed password in the format used by this application. It takes
|
||||
|
@ -219,10 +219,6 @@ ones:
|
||||
Further examples are available in the :ref:`model field reference
|
||||
<field-choices>`.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for mappings and callables was added.
|
||||
|
||||
:attr:`~Field.default`
|
||||
The default value for the field. This can be a value or a callable
|
||||
object. If callable it will be called every time a new object is
|
||||
|
@ -564,8 +564,6 @@ See :ref:`ref-forms-api-outputting-html` for more details.
|
||||
Reusable field group templates
|
||||
------------------------------
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
Each field is available as an attribute of the form, using
|
||||
``{{ form.name_of_field }}`` in a template. A field has a
|
||||
:meth:`~django.forms.BoundField.as_field_group` method which renders the
|
||||
|
@ -33,26 +33,14 @@ a :class:`django.http.HttpResponseNotAllowed` if the conditions are not met.
|
||||
|
||||
Note that request methods should be in uppercase.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for wrapping asynchronous view functions was added.
|
||||
|
||||
.. function:: require_GET()
|
||||
|
||||
Decorator to require that a view only accepts the GET method.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for wrapping asynchronous view functions was added.
|
||||
|
||||
.. function:: require_POST()
|
||||
|
||||
Decorator to require that a view only accepts the POST method.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for wrapping asynchronous view functions was added.
|
||||
|
||||
.. function:: require_safe()
|
||||
|
||||
Decorator to require that a view only accepts the GET and HEAD methods.
|
||||
@ -67,10 +55,6 @@ a :class:`django.http.HttpResponseNotAllowed` if the conditions are not met.
|
||||
such as link checkers, rely on HEAD requests, you might prefer
|
||||
using ``require_safe`` instead of ``require_GET``.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for wrapping asynchronous view functions was added.
|
||||
|
||||
Conditional view processing
|
||||
===========================
|
||||
|
||||
@ -87,10 +71,6 @@ control caching behavior on particular views.
|
||||
headers; see
|
||||
:doc:`conditional view processing </topics/conditional-view-processing>`.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for wrapping asynchronous view functions was added.
|
||||
|
||||
.. module:: django.views.decorators.gzip
|
||||
|
||||
GZip compression
|
||||
@ -105,10 +85,6 @@ compression on a per-view basis.
|
||||
It sets the ``Vary`` header accordingly, so that caches will base their
|
||||
storage on the ``Accept-Encoding`` header.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for wrapping asynchronous view functions was added.
|
||||
|
||||
.. module:: django.views.decorators.vary
|
||||
|
||||
Vary headers
|
||||
@ -119,10 +95,6 @@ caching based on specific request headers.
|
||||
|
||||
.. function:: vary_on_cookie(func)
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for wrapping asynchronous view functions was added.
|
||||
|
||||
.. function:: vary_on_headers(*headers)
|
||||
|
||||
The ``Vary`` header defines which request headers a cache mechanism should take
|
||||
@ -130,10 +102,6 @@ caching based on specific request headers.
|
||||
|
||||
See :ref:`using vary headers <using-vary-headers>`.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for wrapping asynchronous view functions was added.
|
||||
|
||||
.. module:: django.views.decorators.cache
|
||||
|
||||
Caching
|
||||
@ -149,10 +117,6 @@ client-side caching.
|
||||
:func:`~django.utils.cache.patch_cache_control` for the details of the
|
||||
transformation.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for wrapping asynchronous view functions was added.
|
||||
|
||||
.. function:: never_cache(view_func)
|
||||
|
||||
This decorator adds an ``Expires`` header to the current date/time.
|
||||
@ -163,10 +127,6 @@ client-side caching.
|
||||
|
||||
Each header is only added if it isn't already set.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for wrapping asynchronous view functions was added.
|
||||
|
||||
.. module:: django.views.decorators.common
|
||||
|
||||
Common
|
||||
@ -180,6 +140,3 @@ customization of :class:`~django.middleware.common.CommonMiddleware` behavior.
|
||||
This decorator allows individual views to be excluded from
|
||||
:setting:`APPEND_SLASH` URL normalization.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for wrapping asynchronous view functions was added.
|
||||
|
@ -239,10 +239,6 @@ Note: As with ``get()``, a
|
||||
:class:`~django.core.exceptions.MultipleObjectsReturned` exception
|
||||
will be raised if more than one object is found.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
``aget_object_or_404()`` function was added.
|
||||
|
||||
``get_list_or_404()``
|
||||
=====================
|
||||
|
||||
@ -291,6 +287,3 @@ This example is equivalent to::
|
||||
if not my_objects:
|
||||
raise Http404("No MyModel matches the given query.")
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
``aget_list_or_404()`` function was added.
|
||||
|
@ -27,10 +27,6 @@ interacting with end users.
|
||||
Time zone support is enabled by default. To disable it, set :setting:`USE_TZ =
|
||||
False <USE_TZ>` in your settings file.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
In older version, time zone support was disabled by default.
|
||||
|
||||
Time zone support uses :mod:`zoneinfo`, which is part of the Python standard
|
||||
library from Python 3.9.
|
||||
|
||||
|
@ -796,11 +796,6 @@ Django can serialize the following:
|
||||
- Any class reference (must be in module's top-level scope)
|
||||
- Anything with a custom ``deconstruct()`` method (:ref:`see below <custom-deconstruct-method>`)
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Serialization support for functions decorated with :func:`functools.cache`
|
||||
or :func:`functools.lru_cache` was added.
|
||||
|
||||
Django cannot serialize:
|
||||
|
||||
- Nested classes
|
||||
|
@ -107,10 +107,6 @@ Signals can be sent either synchronously or asynchronously, and receivers will
|
||||
automatically be adapted to the correct call-style. See :ref:`sending signals
|
||||
<sending-signals>` for more information.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for asynchronous receivers was added.
|
||||
|
||||
.. _connecting-receiver-functions:
|
||||
|
||||
Connecting receiver functions
|
||||
@ -330,10 +326,6 @@ receiver. In addition, async receivers are executed concurrently using
|
||||
All built-in signals, except those in the async request-response cycle, are
|
||||
dispatched using :meth:`Signal.send`.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for asynchronous signals was added.
|
||||
|
||||
Disconnecting signals
|
||||
=====================
|
||||
|
||||
|
@ -628,10 +628,6 @@ and tear down the test suite.
|
||||
custom arguments by calling ``parser.add_argument()`` inside the method, so
|
||||
that the :djadmin:`test` command will be able to use those arguments.
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
The ``durations`` argument was added.
|
||||
|
||||
Attributes
|
||||
~~~~~~~~~~
|
||||
|
||||
|
@ -497,10 +497,6 @@ Use the ``django.test.Client`` class to make requests.
|
||||
:meth:`~django.contrib.auth.models.UserManager.create_user` helper
|
||||
method to create a new user with a correctly hashed password.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
``alogin()`` method was added.
|
||||
|
||||
.. method:: Client.force_login(user, backend=None)
|
||||
.. method:: Client.aforce_login(user, backend=None)
|
||||
|
||||
@ -528,10 +524,6 @@ Use the ``django.test.Client`` class to make requests.
|
||||
``login()`` by :ref:`using a weaker hasher while testing
|
||||
<speeding-up-tests-auth-hashers>`.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
``aforce_login()`` method was added.
|
||||
|
||||
.. method:: Client.logout()
|
||||
.. method:: Client.alogout()
|
||||
|
||||
@ -545,10 +537,6 @@ Use the ``django.test.Client`` class to make requests.
|
||||
and session data cleared to defaults. Subsequent requests will appear
|
||||
to come from an :class:`~django.contrib.auth.models.AnonymousUser`.
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
``alogout()`` method was added.
|
||||
|
||||
Testing responses
|
||||
-----------------
|
||||
|
||||
@ -735,8 +723,6 @@ access these properties as part of a test condition.
|
||||
|
||||
.. method:: Client.asession()
|
||||
|
||||
.. versionadded:: 5.0
|
||||
|
||||
This is similar to the :attr:`session` attribute but it works in async
|
||||
contexts.
|
||||
|
||||
@ -2062,10 +2048,6 @@ test client, with the following exceptions:
|
||||
>>> c = AsyncClient()
|
||||
>>> c.get("/customers/details/", {"name": "fred", "age": 7}, ACCEPT="application/json")
|
||||
|
||||
.. versionchanged:: 5.0
|
||||
|
||||
Support for the ``follow`` parameter was added to the ``AsyncClient``.
|
||||
|
||||
.. versionchanged:: 5.1
|
||||
|
||||
The ``query_params`` argument was added.
|
||||
|
Loading…
Reference in New Issue
Block a user