[Django] #22316: TimeFIeld lacks hour/minute filters

16 views
Skip to first unread message

Django

unread,
Mar 22, 2014, 8:16:11 PM3/22/14
to django-...@googlegroups.com
#22316: TimeFIeld lacks hour/minute filters
----------------------------------------------+--------------------
Reporter: dracos | Owner: nobody
Type: New feature | Status: new
Component: Database layer (models, ORM) | Version: 1.6
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+--------------------
#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.

--
Ticket URL: <https://code.djangoproject.com/ticket/22316>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 22, 2014, 9:17:23 PM3/22/14
to django-...@googlegroups.com
#22316: TimeFIeld lacks hour/minute filters
-------------------------------------+-------------------------------------

Reporter: dracos | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by charettes):

* 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>

Django

unread,
Mar 23, 2014, 5:05:45 AM3/23/14
to django-...@googlegroups.com
#22316: TimeFIeld lacks hour/minute filters
-------------------------------------+-------------------------------------
Reporter: dracos | Owner: mjtamlyn
Type: New feature | Status: assigned

Component: Database layer | Version: master
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by mjtamlyn):

* owner: nobody => mjtamlyn
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/22316#comment:2>

Django

unread,
Mar 23, 2014, 5:09:29 AM3/23/14
to django-...@googlegroups.com
#22316: TimeFIeld lacks hour/minute filters
-------------------------------------+-------------------------------------
Reporter: dracos | Owner: mjtamlyn
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

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>

Django

unread,
Mar 24, 2014, 2:23:03 PM3/24/14
to django-...@googlegroups.com
#22316: TimeFIeld lacks hour/minute filters
-------------------------------------+-------------------------------------
Reporter: dracos | Owner: mjtamlyn
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by omer.drow@…):

Will this be implemented in 1.7?

--
Ticket URL: <https://code.djangoproject.com/ticket/22316#comment:4>

Django

unread,
Mar 24, 2014, 3:11:56 PM3/24/14
to django-...@googlegroups.com
#22316: TimeFIeld lacks hour/minute filters
-------------------------------------+-------------------------------------
Reporter: dracos | Owner: mjtamlyn
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by aaugustin):

No, 1.7 is feature frozen.

--
Ticket URL: <https://code.djangoproject.com/ticket/22316#comment:5>

Django

unread,
May 21, 2015, 7:48:43 PM5/21/15
to django-...@googlegroups.com
#22316: TimeField lacks hour/minute filters

-------------------------------------+-------------------------------------
Reporter: dracos | Owner: mjtamlyn
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

--
Ticket URL: <https://code.djangoproject.com/ticket/22316#comment:6>

Django

unread,
May 22, 2015, 3:37:27 PM5/22/15
to django-...@googlegroups.com
#22316: TimeField lacks hour/minute filters
-------------------------------------+-------------------------------------
Reporter: dracos | Owner: mjtamlyn
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
May 25, 2015, 11:35:20 AM5/25/15
to django-...@googlegroups.com
#22316: TimeField lacks hour/minute filters
-------------------------------------+-------------------------------------
Reporter: dracos | Owner: mjtamlyn
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* needs_better_patch: 0 => 1
* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/22316#comment:8>

Django

unread,
May 31, 2015, 11:57:25 AM5/31/15
to django-...@googlegroups.com
#22316: TimeField lacks hour/minute filters
-------------------------------------+-------------------------------------
Reporter: dracos | Owner: dracos

Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by dracos):

* owner: mjtamlyn => dracos


Comment:

Will work on at DjangoCon EU sprint :)

--
Ticket URL: <https://code.djangoproject.com/ticket/22316#comment:9>

Django

unread,
Jun 4, 2015, 8:51:54 AM6/4/15
to django-...@googlegroups.com
#22316: TimeField lacks hour/minute filters
-------------------------------------+-------------------------------------
Reporter: dracos | Owner: dracos
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by dracos):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/22316#comment:10>

Django

unread,
Jun 4, 2015, 2:20:02 PM6/4/15
to django-...@googlegroups.com
#22316: TimeField lacks hour/minute filters
-------------------------------------+-------------------------------------
Reporter: dracos | Owner: dracos
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by mjtamlyn):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/22316#comment:11>

Django

unread,
Jun 4, 2015, 10:30:19 PM6/4/15
to django-...@googlegroups.com
#22316: TimeField lacks hour/minute filters
-------------------------------------+-------------------------------------
Reporter: dracos | Owner: dracos
Type: New feature | Status: closed

Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* 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>

Reply all
Reply to author
Forward
0 new messages