Opened 14 years ago
Closed 12 years ago
#13654 closed New feature (duplicate)
QuerySet .dates() method should support "hour" and "minute"
Reported by: | Ulrich Petri | Owned by: | Aymeric Augustin |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 1.2 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Design decision needed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Currently QuerySet.dates() only accepts "year", "month" and "day" as values for the kind
parameter. It should also accept "hour" and "minute".
I've attached a patch which adds this capability. (Includes tests and docs)
Attachments (1)
Change History (9)
by , 14 years ago
Attachment: | t13654_2010-05-28.diff added |
---|
comment:1 by , 14 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
comment:2 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → New feature |
comment:13 by , 12 years ago
Owner: | changed from | to
---|
comment:14 by , 12 years ago
A prerequisite is making .dates()
work on datetime fields when USE_TZ
is enabled ie. #17260.
If we start down this path, we should support "seconds" too.
The name of the function should be changed to reflect its new capabilities.
comment:15 by , 12 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
This is really a subset of #17260.
Note:
See TracTickets
for help on using tickets.
Looks like a good patch still valid in the current trunk. I checked the other backends to make sure it wasn't need in other base.py files and only seems to be implemented once in sqlite and I assume it is used by the others databases as well. The only issue I have is semantic, hour and minute are not dates but times.