Opened 18 years ago

Closed 18 years ago

Last modified 14 years ago

#1104 closed enhancement (fixed)

[patch] Correct DateField to not include Time

Reported by: mildly@… Owned by: Adrian Holovaty
Component: Metasystem Version: dev
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 (last modified by Adrian Holovaty)

Index: django/core/meta/fields.py
===================================================================
--- django/core/meta/fields.py  (revision 1764)
+++ django/core/meta/fields.py  (working copy)
@@ -391,9 +391,9 @@

     def get_db_prep_lookup(self, lookup_type, value):
         if lookup_type == 'range':
-            value = [str(v) for v in value]
+            value = [v.strftime("%Y-%m-%d") for v in value]
         else:
-            value = str(value)
+            value = value.strftime("%Y-%m-%d")
         return Field.get_db_prep_lookup(self, lookup_type, value)

     def pre_save(self, value, add):

Change History (5)

comment:1 by Adrian Holovaty, 18 years ago

Description: modified (diff)

Changed formatting in description.

comment:2 by Adrian Holovaty, 18 years ago

Summary: Correct DateField to not include Time[patch] Correct DateField to not include Time

comment:3 by Jacob, 18 years ago

Resolution: invalid
Status: newclosed

Um, without an explanation I'm not going to apply a patch to Django.

comment:4 by Jacob, 14 years ago

Resolution: invalidfixed

(In [12644]) Fixed #1104: set FormWizard.extra_context in __init__ to avoid context leakage.

comment:5 by Jacob, 14 years ago

(In [12645]) [1.1.X] Fixed #1104: set FormWizard.extra_context in __init__ to avoid context leakage.

Backport of [12644] from trunk.

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