mirror of
https://github.com/django/django.git
synced 2025-12-04 00:55:36 +00:00
Removed versionadded/changed annotations for 4.1.
This commit is contained in:
parent
ea92a4dc28
commit
490cccbe7e
49 changed files with 2 additions and 472 deletions
|
|
@ -45,10 +45,6 @@ option.
|
|||
``django.db.models`` logger, like *"Got a database error calling check() on
|
||||
…"* to confirm it's validated properly.
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
In older versions, constraints were not checked during model validation.
|
||||
|
||||
``BaseConstraint``
|
||||
==================
|
||||
|
||||
|
|
@ -71,8 +67,6 @@ constraint.
|
|||
``violation_error_message``
|
||||
---------------------------
|
||||
|
||||
.. versionadded:: 4.1
|
||||
|
||||
.. attribute:: BaseConstraint.violation_error_message
|
||||
|
||||
The error message used when ``ValidationError`` is raised during
|
||||
|
|
@ -82,8 +76,6 @@ The error message used when ``ValidationError`` is raised during
|
|||
``validate()``
|
||||
--------------
|
||||
|
||||
.. versionadded:: 4.1
|
||||
|
||||
.. method:: BaseConstraint.validate(model, instance, exclude=None, using=DEFAULT_DB_ALIAS)
|
||||
|
||||
Validates that the constraint, defined on ``model``, is respected on the
|
||||
|
|
@ -122,10 +114,6 @@ ensures the age field is never less than 18.
|
|||
|
||||
CheckConstraint(check=Q(age__gte=18) | Q(age__isnull=True), name='age_gte_18')
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
The ``violation_error_message`` argument was added.
|
||||
|
||||
``UniqueConstraint``
|
||||
====================
|
||||
|
||||
|
|
@ -253,8 +241,6 @@ creates a unique index on ``username`` using ``varchar_pattern_ops``.
|
|||
``violation_error_message``
|
||||
---------------------------
|
||||
|
||||
.. versionadded:: 4.1
|
||||
|
||||
.. attribute:: UniqueConstraint.violation_error_message
|
||||
|
||||
The error message used when ``ValidationError`` is raised during
|
||||
|
|
|
|||
|
|
@ -784,10 +784,6 @@ and second row.
|
|||
The ``frame`` parameter specifies which other rows that should be used in the
|
||||
computation. See :ref:`window-frames` for details.
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
Support for ``order_by`` by field name references was added.
|
||||
|
||||
For example, to annotate each movie with the average rating for the movies by
|
||||
the same studio in the same genre and release year::
|
||||
|
||||
|
|
@ -1067,11 +1063,6 @@ calling the appropriate methods on the wrapped expression.
|
|||
``nulls_first`` and ``nulls_last`` define how null values are sorted.
|
||||
See :ref:`using-f-to-sort-null-values` for example usage.
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
In older versions, ``nulls_first`` and ``nulls_last`` defaulted to
|
||||
``False``.
|
||||
|
||||
.. deprecated:: 4.1
|
||||
|
||||
Passing ``nulls_first=False`` or ``nulls_last=False`` to ``asc()``
|
||||
|
|
@ -1084,11 +1075,6 @@ calling the appropriate methods on the wrapped expression.
|
|||
``nulls_first`` and ``nulls_last`` define how null values are sorted.
|
||||
See :ref:`using-f-to-sort-null-values` for example usage.
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
In older versions, ``nulls_first`` and ``nulls_last`` defaulted to
|
||||
``False``.
|
||||
|
||||
.. deprecated:: 4.1
|
||||
|
||||
Passing ``nulls_first=False`` or ``nulls_last=False`` to ``desc()``
|
||||
|
|
|
|||
|
|
@ -219,8 +219,4 @@ See the PostgreSQL documentation for more details about `covering indexes`_.
|
|||
covering :class:`SP-GiST indexes
|
||||
<django.contrib.postgres.indexes.SpGistIndex>`.
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
Support for covering SP-GiST indexes with PostgreSQL 14+ was added.
|
||||
|
||||
.. _covering indexes: https://www.postgresql.org/docs/current/indexes-index-only-scans.html
|
||||
|
|
|
|||
|
|
@ -229,11 +229,6 @@ validation errors yourself, or if you have excluded fields from the
|
|||
``django.db.models`` logger, like *"Got a database error calling check() on
|
||||
…"* to confirm it's validated properly.
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
In older versions, constraints were not checked during the model
|
||||
validation.
|
||||
|
||||
.. method:: Model.full_clean(exclude=None, validate_unique=True, validate_constraints=True)
|
||||
|
||||
This method calls :meth:`Model.clean_fields()`, :meth:`Model.clean()`,
|
||||
|
|
@ -263,14 +258,6 @@ models. For example::
|
|||
|
||||
The first step ``full_clean()`` performs is to clean each individual field.
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
The ``validate_constraints`` argument was added.
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
An ``exclude`` value is now converted to a ``set`` rather than a ``list``.
|
||||
|
||||
.. method:: Model.clean_fields(exclude=None)
|
||||
|
||||
This method will validate all fields on your model. The optional ``exclude``
|
||||
|
|
@ -391,15 +378,8 @@ the fields you provided will not be checked.
|
|||
|
||||
Finally, ``full_clean()`` will check any other constraints on your model.
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
In older versions, :class:`~django.db.models.UniqueConstraint`\s were
|
||||
validated by ``validate_unique()``.
|
||||
|
||||
.. method:: Model.validate_constraints(exclude=None)
|
||||
|
||||
.. versionadded:: 4.1
|
||||
|
||||
This method validates all constraints defined in
|
||||
:attr:`Meta.constraints <django.db.models.Options.constraints>`. The
|
||||
optional ``exclude`` argument allows you to provide a ``set`` of field names to
|
||||
|
|
|
|||
|
|
@ -43,10 +43,6 @@ You can evaluate a ``QuerySet`` in the following ways:
|
|||
Both synchronous and asynchronous iterators of QuerySets share the same
|
||||
underlying cache.
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
Support for asynchronous iteration was added.
|
||||
|
||||
* **Slicing.** As explained in :ref:`limiting-querysets`, a ``QuerySet`` can
|
||||
be sliced, using Python's array-slicing syntax. Slicing an unevaluated
|
||||
``QuerySet`` usually returns another unevaluated ``QuerySet``, but Django
|
||||
|
|
@ -1250,10 +1246,8 @@ could be generated, which, depending on the database, might have performance
|
|||
problems of its own when it comes to parsing or executing the SQL query. Always
|
||||
profile for your use case!
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
If you use ``iterator()`` to run the query, ``prefetch_related()``
|
||||
calls will only be observed if a value for ``chunk_size`` is provided.
|
||||
If you use ``iterator()`` to run the query, ``prefetch_related()`` calls will
|
||||
only be observed if a value for ``chunk_size`` is provided.
|
||||
|
||||
You can use the :class:`~django.db.models.Prefetch` object to further control
|
||||
the prefetch operation.
|
||||
|
|
@ -1955,8 +1949,6 @@ may be generated.
|
|||
XOR (``^``)
|
||||
~~~~~~~~~~~
|
||||
|
||||
.. versionadded:: 4.1
|
||||
|
||||
Combines two ``QuerySet``\s using the SQL ``XOR`` operator.
|
||||
|
||||
The following are equivalent::
|
||||
|
|
@ -2003,10 +1995,6 @@ this reason, each has a corresponding asynchronous version with an ``a`` prefix
|
|||
There is usually no difference in behavior apart from their asynchronous
|
||||
nature, but any differences are noted below next to each method.
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
The asynchronous versions of each method, prefixed with ``a`` was added.
|
||||
|
||||
``get()``
|
||||
~~~~~~~~~
|
||||
|
||||
|
|
@ -2053,10 +2041,6 @@ can use :exc:`django.core.exceptions.ObjectDoesNotExist` to handle
|
|||
except ObjectDoesNotExist:
|
||||
print("Either the blog or entry doesn't exist.")
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
``aget()`` method was added.
|
||||
|
||||
``create()``
|
||||
~~~~~~~~~~~~
|
||||
|
||||
|
|
@ -2084,10 +2068,6 @@ database, a call to ``create()`` will fail with an
|
|||
:exc:`~django.db.IntegrityError` since primary keys must be unique. Be
|
||||
prepared to handle the exception if you are using manual primary keys.
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
``acreate()`` method was added.
|
||||
|
||||
``get_or_create()``
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
|
@ -2216,10 +2196,6 @@ whenever a request to a page has a side effect on your data. For more, see
|
|||
chapter because it isn't related to that book, but it can't create it either
|
||||
because ``title`` field should be unique.
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
``aget_or_create()`` method was added.
|
||||
|
||||
``update_or_create()``
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
|
@ -2273,10 +2249,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:: 4.1
|
||||
|
||||
``aupdate_or_create()`` method was added.
|
||||
|
||||
.. versionchanged:: 4.2
|
||||
|
||||
In older versions, ``update_or_create()`` didn't specify ``update_fields``
|
||||
|
|
@ -2354,14 +2326,6 @@ support it).
|
|||
.. _MySQL documentation: https://dev.mysql.com/doc/refman/en/sql-mode.html#ignore-strict-comparison
|
||||
.. _MariaDB documentation: https://mariadb.com/kb/en/ignore/
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
The ``update_conflicts``, ``update_fields``, and ``unique_fields``
|
||||
parameters were added to support updating fields when a row insertion fails
|
||||
on conflict.
|
||||
|
||||
``abulk_create()`` method was added.
|
||||
|
||||
``bulk_update()``
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
|
@ -2407,10 +2371,6 @@ The ``batch_size`` parameter controls how many objects are saved in a single
|
|||
query. The default is to update all objects in one batch, except for SQLite
|
||||
and Oracle which have restrictions on the number of variables used in a query.
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
``abulk_update()`` method was added.
|
||||
|
||||
``count()``
|
||||
~~~~~~~~~~~
|
||||
|
||||
|
|
@ -2443,10 +2403,6 @@ database query like ``count()`` would.
|
|||
If the queryset has already been fully retrieved, ``count()`` will use that
|
||||
length rather than perform an extra database query.
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
``acount()`` method was added.
|
||||
|
||||
``in_bulk()``
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
|
|
@ -2482,10 +2438,6 @@ Example::
|
|||
|
||||
If you pass ``in_bulk()`` an empty list, you'll get an empty dictionary.
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
``ain_bulk()`` method was added.
|
||||
|
||||
``iterator()``
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
|
|
@ -2532,12 +2484,6 @@ value for ``chunk_size`` will result in Django using an implicit default of
|
|||
Depending on the database backend, query results will either be loaded all at
|
||||
once or streamed from the database using server-side cursors.
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
Support for prefetching related objects was added to ``iterator()``.
|
||||
|
||||
``aiterator()`` method was added.
|
||||
|
||||
.. deprecated:: 4.1
|
||||
|
||||
Using ``iterator()`` on a queryset that prefetches related objects without
|
||||
|
|
@ -2640,10 +2586,6 @@ readability.
|
|||
|
||||
Entry.objects.filter(pub_date__isnull=False).latest('pub_date')
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
``alatest()`` method was added.
|
||||
|
||||
``earliest()``
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
|
|
@ -2655,10 +2597,6 @@ readability.
|
|||
Works otherwise like :meth:`~django.db.models.query.QuerySet.latest` except
|
||||
the direction is changed.
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
``aearliest()`` method was added.
|
||||
|
||||
``first()``
|
||||
~~~~~~~~~~~
|
||||
|
||||
|
|
@ -2684,10 +2622,6 @@ equivalent to the above example::
|
|||
except IndexError:
|
||||
p = None
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
``afirst()`` method was added.
|
||||
|
||||
``last()``
|
||||
~~~~~~~~~~
|
||||
|
||||
|
|
@ -2698,10 +2632,6 @@ equivalent to the above example::
|
|||
|
||||
Works like :meth:`first()`, but returns the last object in the queryset.
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
``alast()`` method was added.
|
||||
|
||||
``aggregate()``
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
|
|
@ -2741,10 +2671,6 @@ control the name of the aggregation value that is returned::
|
|||
For an in-depth discussion of aggregation, see :doc:`the topic guide on
|
||||
Aggregation </topics/db/aggregation>`.
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
``aaggregate()`` method was added.
|
||||
|
||||
``exists()``
|
||||
~~~~~~~~~~~~
|
||||
|
||||
|
|
@ -2781,10 +2707,6 @@ more overall work (one query for the existence check plus an extra one to later
|
|||
retrieve the results) than using ``bool(some_queryset)``, which retrieves the
|
||||
results and then checks if any were returned.
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
``aexists()`` method was added.
|
||||
|
||||
``contains()``
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
|
|
@ -2815,10 +2737,6 @@ know that it will be at some point, then using ``some_queryset.contains(obj)``
|
|||
will make an additional database query, generally resulting in slower overall
|
||||
performance.
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
``acontains()`` method was added.
|
||||
|
||||
``update()``
|
||||
~~~~~~~~~~~~
|
||||
|
||||
|
|
@ -2896,10 +2814,6 @@ update a bunch of records for a model that has a custom
|
|||
e.comments_on = False
|
||||
e.save()
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
``aupdate()`` method was added.
|
||||
|
||||
Ordered queryset
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
|
|
@ -2971,10 +2885,6 @@ ForeignKeys which are set to :attr:`~django.db.models.ForeignKey.on_delete`
|
|||
Note that the queries generated in object deletion is an implementation
|
||||
detail subject to change.
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
``adelete()`` method was added.
|
||||
|
||||
``as_manager()``
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
|
|
@ -3033,10 +2943,6 @@ adverse effects on your database. For example, the ``ANALYZE`` flag supported
|
|||
by MariaDB, MySQL 8.0.18+, and PostgreSQL could result in changes to data if
|
||||
there are triggers or if a function is called, even for a ``SELECT`` query.
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
``aexplain()`` method was added.
|
||||
|
||||
.. _field-lookups:
|
||||
|
||||
``Field`` lookups
|
||||
|
|
@ -3982,10 +3888,6 @@ or annotation. They make it possible to define and reuse conditions, and
|
|||
combine them using operators such as ``|`` (``OR``), ``&`` (``AND``), and ``^``
|
||||
(``XOR``). See :ref:`complex-lookups-with-q`.
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
Support for the ``^`` (``XOR``) operator was added.
|
||||
|
||||
``Prefetch()`` objects
|
||||
----------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -120,10 +120,6 @@ Related objects reference
|
|||
needed. You can use callables as values in the ``through_defaults``
|
||||
dictionary.
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
``acreate()`` method was added.
|
||||
|
||||
.. method:: remove(*objs, bulk=True)
|
||||
.. method:: aremove(*objs, bulk=True)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue