Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#1754 closed defect (fixed)

[patch] models.DateField should allow string lookups

Reported by: Esaj Owned by: adrian
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 10 years ago.

Download all attachments as: .zip

Change History (3)

Changed 10 years ago by Esaj

comment:1 Changed 10 years ago by mtredinnick

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

comment:2 Changed 10 years ago by mtredinnick

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

(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