diff options
| author | Jon Dufresne <jon.dufresne@gmail.com> | 2015-03-07 13:20:29 -0800 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-06-02 08:49:10 -0400 |
| commit | 44f3ee77166bd5c0e8a4604f2d96015268dce100 (patch) | |
| tree | 733d47ee8d00d3934ae86d8b26275ad4fde4d371 /docs/ref/models | |
| parent | 076a63e672370ff1735e7942cd1ae0990bcbd263 (diff) | |
Fixed #9596 -- Added date transform for DateTimeField.
Diffstat (limited to 'docs/ref/models')
| -rw-r--r-- | docs/ref/models/querysets.txt | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt index 0ad944fe3a..0a0749d0c9 100644 --- a/docs/ref/models/querysets.txt +++ b/docs/ref/models/querysets.txt @@ -2463,6 +2463,27 @@ numbers and even characters. Generally speaking, you can't mix dates and datetimes. +.. fieldlookup:: date + +date +~~~~ + +.. versionadded:: 1.9 + +For datetime fields, casts the value as date. Allows chaining additional field +lookups. Takes a date value. + +Example:: + + Entry.objects.filter(pub_date__date=datetime.date(2005, 1, 1)) + Entry.objects.filter(pub_date__date__gt=datetime.date(2005, 1, 1)) + +(No equivalent SQL code fragment is included for this lookup because +implementation of the relevant query varies among different database engines.) + +When :setting:`USE_TZ` is ``True``, fields are converted to the current time +zone before filtering. + .. fieldlookup:: year year |
