Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#1754 closed defect (fixed)

[patch] models.DateField should allow string lookups

Reported by: Esaj Owned by: Adrian Holovaty
Component: Database layer (models, ORM) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


At the moment DateField.get_db_prep_lookup assumes that values passed to it are datetime objects when doing certain lookup types.

This patch falls back to using str(value), which means that various date lookup queries can work in the admin changelist.

Attachments (1) (648 bytes) - added by Esaj 12 years ago.

Download all attachments as: .zip

Change History (3)

Changed 12 years ago by Esaj

Attachment: added

comment:1 Changed 12 years ago by Malcolm Tredinnick

See also #2211. Not sure which patch is better at the moment.

comment:2 Changed 12 years ago by Malcolm Tredinnick

Resolution: fixed
Status: newclosed

(In [3223]) Fixed #1754, #2211, #2192 -- allow date filtering comparisons to use strings as
well as date objects. Fixed a couple of admin crashes as well.

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