Django

Code

Ticket #1754 (closed: fixed)

Opened 3 years ago

Last modified 2 years ago

[patch] models.DateField should allow string lookups

Reported by: Esaj Assigned to: adrian
Milestone: Component: Database layer (models, ORM)
Version: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

__init__.py.diff (0.6 kB) - added by Esaj on 05/03/06 09:35:45.

Change History

05/03/06 09:35:45 changed by Esaj

  • attachment __init__.py.diff added.

06/21/06 20:53:17 changed by mtredinnick

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

06/28/06 06:37:18 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

(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.


Add/Change #1754 ([patch] models.DateField should allow string lookups)




Change Properties
Action