diff options
| author | Hasan Ramezani <hasan.r67@gmail.com> | 2020-02-18 18:12:51 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-03-20 12:55:33 +0100 |
| commit | 53b6a466d89f972aa435fe7b5135e9b501ce68ee (patch) | |
| tree | 79764700fb91a071c231e7351f4919303b927998 /docs | |
| parent | 2695ac8e0441b4d7e5460eac3bb7ea315164a6bf (diff) | |
Refs #29724 -- Added is_dst parameter to QuerySet.datetimes().
Thanks Simon Charette for the review and Mariusz Felisiak for tests.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/models/querysets.txt | 10 | ||||
| -rw-r--r-- | docs/releases/3.1.txt | 3 |
2 files changed, 12 insertions, 1 deletions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt index 6b042d305e..9647b1a8ff 100644 --- a/docs/ref/models/querysets.txt +++ b/docs/ref/models/querysets.txt @@ -759,7 +759,7 @@ Examples:: ``datetimes()`` ~~~~~~~~~~~~~~~ -.. method:: datetimes(field_name, kind, order='ASC', tzinfo=None) +.. method:: datetimes(field_name, kind, order='ASC', tzinfo=None, is_dst=None) Returns a ``QuerySet`` that evaluates to a list of :class:`datetime.datetime` objects representing all available dates of a particular kind within the @@ -781,6 +781,14 @@ object. If it's ``None``, Django uses the :ref:`current time zone <default-current-time-zone>`. It has no effect when :setting:`USE_TZ` is ``False``. +``is_dst`` 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.1 + + The ``is_dst`` parameter was added. + .. _database-time-zone-definitions: .. note:: diff --git a/docs/releases/3.1.txt b/docs/releases/3.1.txt index 77a71bbc43..44ba489a44 100644 --- a/docs/releases/3.1.txt +++ b/docs/releases/3.1.txt @@ -324,6 +324,9 @@ Models :meth:`~.RelatedManager.set` methods now accept callables as values in the ``through_defaults`` argument. +* The new ``is_dst`` parameter of the :meth:`.QuerySet.datetimes` determines + the treatment of nonexistent and ambiguous datetimes. + Pagination ~~~~~~~~~~ |
