A workaround is to use a DateTimeField and hide/set the date part within
the model.
--
Ticket URL: <https://code.djangoproject.com/ticket/22316>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_docs: => 0
* needs_better_patch: => 0
* version: 1.6 => master
* needs_tests: => 0
* stage: Unreviewed => Accepted
Comment:
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
for `TimeField`.
--
Ticket URL: <https://code.djangoproject.com/ticket/22316#comment:1>
* owner: nobody => mjtamlyn
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/22316#comment:2>
Comment (by aaugustin):
I added the lookups to `DateTimeField` despite the potential for clashes.
I was working in the context of time zone support and simply didn't think
about `TimeField`.
--
Ticket URL: <https://code.djangoproject.com/ticket/22316#comment:3>
Comment (by omer.drow@…):
Will this be implemented in 1.7?
--
Ticket URL: <https://code.djangoproject.com/ticket/22316#comment:4>
Comment (by aaugustin):
No, 1.7 is feature frozen.
--
Ticket URL: <https://code.djangoproject.com/ticket/22316#comment:5>
--
Ticket URL: <https://code.djangoproject.com/ticket/22316#comment:6>
Comment (by dracos):
It looks like this was actually implemented for non-SQLite backends in 1.7
(I think as a side effect of #16187?), but on master it doesn't work in
SQLite due to it having to use Python for date/time related functions. I
have opened a PR that hopefully adds SQLite support for
https://github.com/django/django/pull/4698
--
Ticket URL: <https://code.djangoproject.com/ticket/22316#comment:7>
* needs_better_patch: 0 => 1
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/22316#comment:8>
* owner: mjtamlyn => dracos
Comment:
Will work on at DjangoCon EU sprint :)
--
Ticket URL: <https://code.djangoproject.com/ticket/22316#comment:9>
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/22316#comment:10>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/22316#comment:11>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"2dc93bb10ab1c2af1df9977f1b51d47cadab7b21" 2dc93bb]:
{{{
#!CommitTicketReference repository=""
revision="2dc93bb10ab1c2af1df9977f1b51d47cadab7b21"
Fixed #22316 -- Added time filters to TimeField on SQLite.
This was implemented for non-SQLite backends in 1.7 (as a
side effect of #16187).
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22316#comment:12>