mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Removed versionadded/changed annotations for 3.0.
This commit is contained in:
parent
3b94f12462
commit
4c5236ef93
39 changed files with 2 additions and 299 deletions
|
@ -48,10 +48,6 @@ objects that have an ``output_field`` that is a
|
|||
:class:`~django.db.models.BooleanField`. The result is provided using the
|
||||
``then`` keyword.
|
||||
|
||||
.. versionchanged:: 3.0
|
||||
|
||||
Support for boolean :class:`~django.db.models.Expression` was added.
|
||||
|
||||
Some examples::
|
||||
|
||||
>>> from django.db.models import F, Q, When
|
||||
|
@ -252,8 +248,6 @@ The two SQL statements are functionally equivalent but the more explicit
|
|||
Conditional filter
|
||||
------------------
|
||||
|
||||
.. versionadded:: 3.0
|
||||
|
||||
When a conditional expression returns a boolean value, it is possible to use it
|
||||
directly in filters. This means that it will not be added to the ``SELECT``
|
||||
columns, but you can still use it to filter results::
|
||||
|
|
|
@ -69,10 +69,6 @@ ensures the age field is never less than 18.
|
|||
|
||||
The name of the constraint.
|
||||
|
||||
.. versionchanged:: 3.0
|
||||
|
||||
Interpolation of ``'%(app_label)s'`` and ``'%(class)s'`` was added.
|
||||
|
||||
``UniqueConstraint``
|
||||
====================
|
||||
|
||||
|
@ -99,10 +95,6 @@ date.
|
|||
|
||||
The name of the constraint.
|
||||
|
||||
.. versionchanged:: 3.0
|
||||
|
||||
Interpolation of ``'%(app_label)s'`` and ``'%(class)s'`` was added.
|
||||
|
||||
``condition``
|
||||
-------------
|
||||
|
||||
|
|
|
@ -479,10 +479,6 @@ The ``is_dst`` parameter indicates whether or not ``pytz`` should interpret
|
|||
nonexistent and ambiguous datetimes in daylight saving time. By default (when
|
||||
``is_dst=None``), ``pytz`` raises an exception for such datetimes.
|
||||
|
||||
.. versionadded:: 3.0
|
||||
|
||||
The ``is_dst`` parameter was added.
|
||||
|
||||
Given the datetime ``2015-06-15 14:30:50.000321+00:00``, the built-in ``kind``\s
|
||||
return:
|
||||
|
||||
|
@ -1120,8 +1116,6 @@ It can also be registered as a transform. For example::
|
|||
|
||||
.. class:: Sign(expression, **extra)
|
||||
|
||||
.. versionadded:: 3.0
|
||||
|
||||
Returns the sign (-1, 0, 1) of a numeric field or expression.
|
||||
|
||||
Usage example::
|
||||
|
@ -1357,8 +1351,6 @@ spaces.
|
|||
|
||||
.. class:: MD5(expression, **extra)
|
||||
|
||||
.. versionadded:: 3.0
|
||||
|
||||
Accepts a single text field or expression and returns the MD5 hash of the
|
||||
string.
|
||||
|
||||
|
@ -1489,8 +1481,6 @@ spaces.
|
|||
.. class:: SHA384(expression, **extra)
|
||||
.. class:: SHA512(expression, **extra)
|
||||
|
||||
.. versionadded:: 3.0
|
||||
|
||||
Accepts a single text field or expression and returns the particular hash of
|
||||
the string.
|
||||
|
||||
|
|
|
@ -641,13 +641,6 @@ directly filter a queryset::
|
|||
This will ensure that the subquery will not be added to the ``SELECT`` columns,
|
||||
which may result in a better performance.
|
||||
|
||||
.. versionchanged:: 3.0
|
||||
|
||||
In previous versions of Django, it was necessary to first annotate and then
|
||||
filter against the annotation. This resulted in the annotated value always
|
||||
being present in the query result, and often resulted in a query that took
|
||||
more time to execute.
|
||||
|
||||
Using aggregates within a ``Subquery`` expression
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
@ -995,10 +988,6 @@ calling the appropriate methods on the wrapped expression.
|
|||
to a column. The ``alias`` parameter will be ``None`` unless the
|
||||
expression has been annotated and is used for grouping.
|
||||
|
||||
.. versionchanged:: 3.0
|
||||
|
||||
The ``alias`` parameter was added.
|
||||
|
||||
.. method:: asc(nulls_first=False, nulls_last=False)
|
||||
|
||||
Returns the expression ready to be sorted in ascending order.
|
||||
|
|
|
@ -301,10 +301,6 @@ There are some additional caveats to be aware of:
|
|||
|
||||
__empty__ = _('(Unknown)')
|
||||
|
||||
.. versionadded:: 3.0
|
||||
|
||||
The ``TextChoices``, ``IntegerChoices``, and ``Choices`` classes were added.
|
||||
|
||||
``db_column``
|
||||
-------------
|
||||
|
||||
|
@ -816,10 +812,6 @@ Has two optional arguments:
|
|||
class MyModel(models.Model):
|
||||
upload = models.FileField(upload_to=user_directory_path)
|
||||
|
||||
.. versionchanged:: 3.0
|
||||
|
||||
Support for :class:`pathlib.Path` was added.
|
||||
|
||||
.. attribute:: FileField.storage
|
||||
|
||||
A storage object, or a callable which returns a storage object. This
|
||||
|
@ -1030,10 +1022,6 @@ directory on the filesystem. Has some special arguments, of which the first is
|
|||
class MyModel(models.Model):
|
||||
file = models.FilePathField(path=images_path)
|
||||
|
||||
.. versionchanged:: 3.0
|
||||
|
||||
``path`` can now be a callable.
|
||||
|
||||
.. attribute:: FilePathField.match
|
||||
|
||||
Optional. A regular expression, as a string, that :class:`FilePathField`
|
||||
|
@ -1315,8 +1303,6 @@ It uses :class:`~django.core.validators.validate_slug` or
|
|||
|
||||
.. class:: SmallAutoField(**options)
|
||||
|
||||
.. versionadded:: 3.0
|
||||
|
||||
Like an :class:`AutoField`, but only allows values under a certain
|
||||
(database-dependent) limit. Values from ``1`` to ``32767`` are safe in all
|
||||
databases supported by Django.
|
||||
|
@ -1820,11 +1806,6 @@ that control how the relationship functions.
|
|||
add the descriptor for the reverse relationship, allowing
|
||||
:class:`ManyToManyField` relationships to be non-symmetrical.
|
||||
|
||||
.. versionchanged:: 3.0
|
||||
|
||||
Specifying ``symmetrical=True`` for recursive many-to-many
|
||||
relationships using an intermediary model was allowed.
|
||||
|
||||
.. attribute:: ManyToManyField.through
|
||||
|
||||
Django will automatically generate a table to manage many-to-many
|
||||
|
@ -2078,8 +2059,6 @@ Field API reference
|
|||
|
||||
.. attribute:: descriptor_class
|
||||
|
||||
.. versionadded:: 3.0
|
||||
|
||||
A class implementing the :py:ref:`descriptor protocol <descriptors>`
|
||||
that is instantiated and assigned to the model instance attribute. The
|
||||
constructor must accept a single argument, the ``Field`` instance.
|
||||
|
|
|
@ -61,10 +61,6 @@ than 30 characters and shouldn't start with a number (0-9) or underscore (_).
|
|||
concrete model. For example ``Index(fields=['title'],
|
||||
name='%(app_label)s_%(class)s_title_index')``.
|
||||
|
||||
.. versionchanged:: 3.0
|
||||
|
||||
Interpolation of ``'%(app_label)s'`` and ``'%(class)s'`` was added.
|
||||
|
||||
``db_tablespace``
|
||||
-----------------
|
||||
|
||||
|
|
|
@ -496,12 +496,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:: 3.0
|
||||
|
||||
``Model.save()`` no longer attempts to find a row when saving a new
|
||||
``Model`` instance and a default value for the primary key is provided, and
|
||||
always executes an ``INSERT``.
|
||||
|
||||
.. _ref-models-force-insert:
|
||||
|
||||
Forcing an INSERT or UPDATE
|
||||
|
|
|
@ -3455,10 +3455,6 @@ by the aggregate.
|
|||
This is the SQL equivalent of ``AVG(DISTINCT <field>)``. The default
|
||||
value is ``False``.
|
||||
|
||||
.. versionchanged:: 3.0
|
||||
|
||||
Support for ``distinct=True`` was added.
|
||||
|
||||
``Count``
|
||||
~~~~~~~~~
|
||||
|
||||
|
@ -3534,10 +3530,6 @@ by the aggregate.
|
|||
the SQL equivalent of ``SUM(DISTINCT <field>)``. The default value is
|
||||
``False``.
|
||||
|
||||
.. versionchanged:: 3.0
|
||||
|
||||
Support for ``distinct=True`` was added.
|
||||
|
||||
``Variance``
|
||||
~~~~~~~~~~~~
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue