Opened 14 years ago

Closed 13 years ago

Last modified 10 years ago

#7546 closed (fixed)

Exact lookups on DateTimeField() with object does not work

Reported by: John-Scott Atlakson Owned by: nobody
Component: Documentation Version: dev
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


In there are several examples of passing in objects (notice it's not a datetime.datetime() object) as lookup parameters on a DateTimeField(). See for one such example:


The only way I've been able to get the intended behavior is through the use of the range lookup:

today =, 6, 26)
tomorrow =, 6, 27)
        entry__pub_date__range=(today, tomorrow))

I'm assuming this is just a documentation issue, rather than a query bug.

Attachments (1)

7546.diff (1.7 KB) - added by Dan Watson 14 years ago.
doc update

Download all attachments as: .zip

Change History (6)

comment:1 Changed 14 years ago by Marc Garcia

milestone: 1.0

comment:2 Changed 14 years ago by Dan Watson

Has patch: set

Speaking to the author of this documentation (Malcolm wishes to remain nameless), this is indeed a documentation bug. Patch to follow.

Changed 14 years ago by Dan Watson

Attachment: 7546.diff added

doc update

comment:3 Changed 13 years ago by anonymous

Triage Stage: UnreviewedReady for checkin

comment:4 Changed 13 years ago by Malcolm Tredinnick

Resolution: fixed
Status: newclosed

(In [8232]) Fixed #7546 -- Fixed an incorrect example in the docs that was misleading some
people. Patch from Dan Watson.

comment:5 Changed 10 years ago by Jacob

milestone: 1.0

Milestone 1.0 deleted

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