Opened 15 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)

t13654_2010-05-28.diff (5.1 KB ) - added by Ulrich Petri 15 years ago.

Download all attachments as: .zip

Change History (9)

by Ulrich Petri, 15 years ago

Attachment: t13654_2010-05-28.diff added

comment:1 by None, 14 years ago

Triage Stage: UnreviewedDesign decision needed

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.

comment:2 by Julien Phalip, 14 years ago

Severity: Normal
Type: New feature

comment:3 by Jacob, 13 years ago

milestone: 1.3

Milestone 1.3 deleted

comment:11 by Aymeric Augustin, 13 years ago

UI/UX: unset

Change UI/UX from NULL to False.

comment:12 by Aymeric Augustin, 13 years ago

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:13 by Aymeric Augustin, 12 years ago

Owner: changed from Ulrich Petri to Aymeric Augustin

comment:14 by Aymeric Augustin, 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 Aymeric Augustin, 12 years ago

Resolution: duplicate
Status: newclosed

This is really a subset of #17260.

Note: See TracTickets for help on using tickets.
Back to Top