mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #26348 -- Added TruncTime and exposed it through the __time lookup.
Thanks Tim for the review.
This commit is contained in:
@@ -686,6 +686,17 @@ that deal with time-parts can be used with ``TimeField``::
|
||||
truncate function. It's also registered as a transform on ``DateTimeField`` as
|
||||
``__date``.
|
||||
|
||||
.. class:: TruncTime(expression, **extra)
|
||||
|
||||
.. versionadded:: 1.11
|
||||
|
||||
.. attribute:: lookup_name = 'time'
|
||||
.. attribute:: output_field = TimeField()
|
||||
|
||||
``TruncTime`` casts ``expression`` to a time rather than using the built-in SQL
|
||||
truncate function. It's also registered as a transform on ``DateTimeField`` as
|
||||
``__time``.
|
||||
|
||||
.. class:: TruncDay(expression, output_field=None, tzinfo=None, **extra)
|
||||
|
||||
.. attribute:: kind = 'day'
|
||||
|
||||
Reference in New Issue
Block a user