Opened 6 years ago

Closed 4 years ago

#13654 closed New feature (duplicate)

QuerySet .dates() method should support "hour" and "minute"

Reported by: UloPe Owned by: aaugustin
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


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

Download all attachments as: .zip

Change History (9)

Changed 6 years ago by UloPe

comment:1 Changed 6 years ago by glassresistor

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design 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 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

  • Severity set to Normal
  • Type set to New feature

comment:3 Changed 5 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

comment:11 Changed 5 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

comment:12 Changed 5 years ago by aaugustin

  • Easy pickings unset

Change Easy pickings from NULL to False.

comment:13 Changed 4 years ago by aaugustin

  • Owner changed from UloPe to aaugustin

comment:14 Changed 4 years ago by aaugustin

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 aaugustin

  • Resolution set to duplicate
  • Status changed from new to closed

This is really a subset of #17260.

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