Opened 6 years ago

Closed 4 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 6 years ago.

Download all attachments as: .zip

Change History (9)

Changed 6 years ago by Ulrich Petri

Attachment: t13654_2010-05-28.diff added

comment:1 Changed 6 years ago by None

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
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 Changed 5 years ago by Julien Phalip

Severity: Normal
Type: New feature

comment:3 Changed 5 years ago by Jacob

milestone: 1.3

Milestone 1.3 deleted

comment:11 Changed 5 years ago by Aymeric Augustin

UI/UX: unset

Change UI/UX from NULL to False.

comment:12 Changed 5 years ago by Aymeric Augustin

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:13 Changed 4 years ago by Aymeric Augustin

Owner: changed from Ulrich Petri to Aymeric Augustin

comment:14 Changed 4 years ago by Aymeric Augustin

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 Changed 4 years ago by Aymeric Augustin

Resolution: duplicate
Status: newclosed

This is really a subset of #17260.

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