Opened 11 years ago

Closed 11 years ago

Last modified 7 years ago

#1104 closed enhancement (fixed)

[patch] Correct DateField to not include Time

Reported by: mildly@… Owned by: Adrian Holovaty
Component: Metasystem Version: master
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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 Changed 11 years ago by Adrian Holovaty

Description: modified (diff)

Changed formatting in description.

comment:2 Changed 11 years ago by Adrian Holovaty

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

comment:3 Changed 11 years ago by Jacob

Resolution: invalid
Status: newclosed

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

comment:4 Changed 7 years ago by Jacob

Resolution: invalidfixed

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

comment:5 Changed 7 years ago by Jacob

(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