diff options
| author | Sigurd Ljødal <sigurd@ljodal.no> | 2017-09-28 22:28:48 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-08-18 13:09:15 -0400 |
| commit | 3e09b37f80ab34cf57e245e1fcdabb3d4ff92a38 (patch) | |
| tree | 7b56c5caeb4d6ebe6b5075c711c36a0572419c6f /docs/ref/models/querysets.txt | |
| parent | c832885a3e8659d4a704bf103d523b610c24e4ec (diff) | |
Fixed #28649 -- Added ExtractIsoYear database function and iso_year lookup.
Diffstat (limited to 'docs/ref/models/querysets.txt')
| -rw-r--r-- | docs/ref/models/querysets.txt | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt index c171d5074f..d2e20261a7 100644 --- a/docs/ref/models/querysets.txt +++ b/docs/ref/models/querysets.txt @@ -2927,6 +2927,26 @@ SQL equivalent:: When :setting:`USE_TZ` is ``True``, datetime fields are converted to the current time zone before filtering. +.. fieldlookup:: iso_year + +``iso_year`` +~~~~~~~~~~~~ + +.. versionadded:: 2.2 + +For date and datetime fields, an exact ISO 8601 week-numbering year match. +Allows chaining additional field lookups. Takes an integer year. + +Example:: + + Entry.objects.filter(pub_date__iso_year=2005) + Entry.objects.filter(pub_date__iso_year__gte=2005) + +(The exact SQL syntax varies for each database engine.) + +When :setting:`USE_TZ` is ``True``, datetime fields are converted to the +current time zone before filtering. + .. fieldlookup:: month ``month`` |
