Opened 18 years ago

Closed 18 years ago

Last modified 18 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: no UI/UX: no

Description

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)

__init__.py.diff (648 bytes ) - added by Esaj 18 years ago.

Download all attachments as: .zip

Change History (3)

by Esaj, 18 years ago

Attachment: __init__.py.diff added

comment:1 by Malcolm Tredinnick, 18 years ago

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

comment:2 by Malcolm Tredinnick, 18 years ago

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