Django

Code

Ticket #1104 (closed: fixed)

Opened 4 years ago

Last modified 3 weeks ago

[patch] Correct DateField to not include Time

Reported by: mildly@abnormal.com Assigned to: adrian
Milestone: Component: Metasystem
Version: SVN Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description (Last modified by adrian)

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):

Attachments

Change History

12/22/05 08:56:03 changed by adrian

  • description changed.

Changed formatting in description.

12/22/05 08:56:48 changed by adrian

  • summary changed from Correct DateField to not include Time to [patch] Correct DateField to not include Time.

02/27/06 17:40:46 changed by jacob

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

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

03/01/10 17:26:08 changed by jacob

  • resolution changed from invalid to fixed.

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

03/01/10 17:26:45 changed by jacob

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

Backport of [12644] from trunk.


Add/Change #1104 ([patch] Correct DateField to not include Time)




Change Properties
Action