TimeField lacks hour/minute filters
#8424 added hour/minute/second filter lookups to DateTimeField, but not TimeField. I'm not sure if this was deliberate, but it would seem useful to have the functionality on TimeFields too if possible.
A workaround is to use a DateTimeField and hide/set the date part within the model.
Triage Stage: |
Unreviewed → Accepted
|
Version: |
1.6 → master
|
Owner: |
changed from nobody to Marc Tamlyn
|
Status: |
new → assigned
|
Summary: |
TimeFIeld lacks hour/minute filters → TimeField lacks hour/minute filters
|
Has patch: |
set
|
Patch needs improvement: |
set
|
Owner: |
changed from Marc Tamlyn to Matthew Somerville
|
Patch needs improvement: |
unset
|
Triage Stage: |
Accepted → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
From the discussion on #8424 it looks like those lookups were only added to
DateTimeField
to prevent possible clashes due to ORM limitations.Now that the ORM lookup system has been overhauled (see #16187) it looks like
django.db.lookups.DateLookup
could be refactored to also account forTimeField
.