Unverified Kaydet (Commit) 8b42a18b authored tarafından Mariusz Felisiak's avatar Mariusz Felisiak

[2.0.x] Refs #28643 -- Reorganized database functions docs.

Thanks Tim Graham for the review.

Backport of ad8036d7 from master
üst edd3601b
...@@ -423,12 +423,12 @@ Models ...@@ -423,12 +423,12 @@ Models
* A proxy model may now inherit multiple proxy models that share a common * A proxy model may now inherit multiple proxy models that share a common
non-abstract parent class. non-abstract parent class.
* Added :class:`~django.db.models.functions.datetime.Extract` functions * Added :class:`~django.db.models.functions.Extract` functions to extract
to extract datetime components as integers, such as year and hour. datetime components as integers, such as year and hour.
* Added :class:`~django.db.models.functions.datetime.Trunc` functions to * Added :class:`~django.db.models.functions.Trunc` functions to truncate a date
truncate a date or datetime to a significant component. They enable queries or datetime to a significant component. They enable queries like
like sales-per-day or sales-per-hour. sales-per-day or sales-per-hour.
* ``Model.__init__()`` now sets values of virtual fields from its keyword * ``Model.__init__()`` now sets values of virtual fields from its keyword
arguments. arguments.
...@@ -894,8 +894,8 @@ Miscellaneous ...@@ -894,8 +894,8 @@ Miscellaneous
yourself. yourself.
* Private expressions ``django.db.models.expressions.Date`` and ``DateTime`` * Private expressions ``django.db.models.expressions.Date`` and ``DateTime``
are removed. The new :class:`~django.db.models.functions.datetime.Trunc` are removed. The new :class:`~django.db.models.functions.Trunc` expressions
expressions provide the same functionality. provide the same functionality.
* The ``_base_manager`` and ``_default_manager`` attributes are removed from * The ``_base_manager`` and ``_default_manager`` attributes are removed from
model instances. They remain accessible on the model class. model instances. They remain accessible on the model class.
......
...@@ -330,16 +330,16 @@ Models ...@@ -330,16 +330,16 @@ Models
(This validator moved to the form field in :doc:`Django 1.11.2 <1.11.2>`.) (This validator moved to the form field in :doc:`Django 1.11.2 <1.11.2>`.)
* Added support for time truncation to * Added support for time truncation to
:class:`~django.db.models.functions.datetime.Trunc` functions. :class:`~django.db.models.functions.Trunc` functions.
* Added the :class:`~django.db.models.functions.datetime.ExtractWeek` function * Added the :class:`~django.db.models.functions.ExtractWeek` function to
to extract the week from :class:`~django.db.models.DateField` and extract the week from :class:`~django.db.models.DateField` and
:class:`~django.db.models.DateTimeField` and exposed it through the :class:`~django.db.models.DateTimeField` and exposed it through the
:lookup:`week` lookup. :lookup:`week` lookup.
* Added the :class:`~django.db.models.functions.datetime.TruncTime` function * Added the :class:`~django.db.models.functions.TruncTime` function to truncate
to truncate :class:`~django.db.models.DateTimeField` to its time component :class:`~django.db.models.DateTimeField` to its time component and exposed it
and exposed it through the :lookup:`time` lookup. through the :lookup:`time` lookup.
* Added support for expressions in :meth:`.QuerySet.values` and * Added support for expressions in :meth:`.QuerySet.values` and
:meth:`~.QuerySet.values_list`. :meth:`~.QuerySet.values_list`.
......
...@@ -245,20 +245,20 @@ Models ...@@ -245,20 +245,20 @@ Models
:attr:`Meta.get_latest_by <django.db.models.Options.get_latest_by>` now :attr:`Meta.get_latest_by <django.db.models.Options.get_latest_by>` now
allow ordering by several fields. allow ordering by several fields.
* Added the :class:`~django.db.models.functions.datetime.ExtractQuarter` * Added the :class:`~django.db.models.functions.ExtractQuarter` function to
function to extract the quarter from :class:`~django.db.models.DateField` and extract the quarter from :class:`~django.db.models.DateField` and
:class:`~django.db.models.DateTimeField`, and exposed it through the :class:`~django.db.models.DateTimeField`, and exposed it through the
:lookup:`quarter` lookup. :lookup:`quarter` lookup.
* Added the :class:`~django.db.models.functions.datetime.TruncQuarter` * Added the :class:`~django.db.models.functions.TruncQuarter` function to
function to truncate :class:`~django.db.models.DateField` and truncate :class:`~django.db.models.DateField` and
:class:`~django.db.models.DateTimeField` to the first day of a quarter. :class:`~django.db.models.DateTimeField` to the first day of a quarter.
* Added the :attr:`~django.db.models.Index.db_tablespace` parameter to * Added the :attr:`~django.db.models.Index.db_tablespace` parameter to
class-based indexes. class-based indexes.
* If the database supports a native duration field (Oracle and PostgreSQL), * If the database supports a native duration field (Oracle and PostgreSQL),
:class:`~django.db.models.functions.datetime.Extract` now works with :class:`~django.db.models.functions.Extract` now works with
:class:`~django.db.models.DurationField`. :class:`~django.db.models.DurationField`.
* Added the ``of`` argument to :meth:`.QuerySet.select_for_update()`, supported * Added the ``of`` argument to :meth:`.QuerySet.select_for_update()`, supported
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment