1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Removed versionadded/changed annotations for 5.0.

This also removes remaining versionadded/changed annotations for older
versions.
This commit is contained in:
Natalia
2024-05-03 14:39:43 -03:00
committed by nessita
parent ec44247f59
commit 05cce083ad
44 changed files with 0 additions and 379 deletions

View File

@@ -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

View File

@@ -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
===========

View File

@@ -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.

View File

@@ -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

View File

@@ -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.

View File

@@ -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

View File

@@ -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>`__,

View File

@@ -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/

View File

@@ -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

View File

@@ -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`.

View File

@@ -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
==================================

View File

@@ -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

View File

@@ -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.**

View File

@@ -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
========

View File

@@ -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

View File

@@ -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.

View File

@@ -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:

View File

@@ -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

View File

@@ -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`

View File

@@ -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

View File

@@ -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``
---------

View File

@@ -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``.

View File

@@ -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

View File

@@ -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

View File

@@ -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
------------------------------

View File

@@ -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:

View File

@@ -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``::

View File

@@ -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``

View File

@@ -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``

View File

@@ -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.