diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/models/database-functions.txt | 16 | ||||
| -rw-r--r-- | docs/releases/2.0.txt | 4 |
2 files changed, 14 insertions, 6 deletions
diff --git a/docs/ref/models/database-functions.txt b/docs/ref/models/database-functions.txt index 9bb36ccafd..acddc7cbe4 100644 --- a/docs/ref/models/database-functions.txt +++ b/docs/ref/models/database-functions.txt @@ -331,12 +331,16 @@ We'll be using the following model in examples of each function:: Extracts a component of a date as a number. -Takes an ``expression`` representing a ``DateField`` or ``DateTimeField`` and a -``lookup_name``, and returns the part of the date referenced by ``lookup_name`` -as an ``IntegerField``. Django usually uses the databases' extract function, so -you may use any ``lookup_name`` that your database supports. A ``tzinfo`` -subclass, usually provided by ``pytz``, can be passed to extract a value in a -specific timezone. +Takes an ``expression`` representing a ``DateField``, ``DateTimeField``, +``TimeField``, or ``DurationField`` and a ``lookup_name``, and returns the part +of the date referenced by ``lookup_name`` as an ``IntegerField``. +Django usually uses the databases' extract function, so you may use any +``lookup_name`` that your database supports. A ``tzinfo`` subclass, usually +provided by ``pytz``, can be passed to extract a value in a specific timezone. + +.. versionchanged:: 2.0 + + Support for ``DurationField`` was added. Given the datetime ``2015-06-15 23:30:01.000321+00:00``, the built-in ``lookup_name``\s return: diff --git a/docs/releases/2.0.txt b/docs/releases/2.0.txt index a68bd48877..078cbbdf2c 100644 --- a/docs/releases/2.0.txt +++ b/docs/releases/2.0.txt @@ -248,6 +248,10 @@ Models * Added the :attr:`~django.db.models.Index.db_tablespace` parameter to class-based indexes. +* 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.DurationField`. + Requests and Responses ~~~~~~~~~~~~~~~~~~~~~~ |
