#9459: forms.DateTimeField() rendered with HiddenInput looses microseconds
-------------------------------+--------------------------------------------
          Reporter:  guettli   |         Owner:  nobody
            Status:  new       |     Milestone:        
         Component:  Forms     |       Version:  1.0   
        Resolution:            |      Keywords:        
             Stage:  Accepted  |     Has_patch:  1     
        Needs_docs:  0         |   Needs_tests:  0     
Needs_better_patch:  1         |  
-------------------------------+--------------------------------------------
Changes (by russellm):

  * needs_better_patch:  0 => 1
  * milestone:  1.1 =>

Comment:

 The proposed patch is extremely brittle - it only works providing you
 don't use a '.' in the your custom rendering of datetime. If you allow an
 input format of '%Y.%m.%d %H:%M:%S", the code will break hard.

 If you dig into the code, it isn't just HiddenField that is affected by
 this - the default DateTimeField also loses milliseconds. Essentially,
 what is required is a way to parse milliseconds from a string. Python 2.6
 adds %f to strftime/strptime, which will solve this problem - you can then
 allow "%Y-%m-%d %H:%M:%S.%f" as an input format. We may need to port
 strftime and strptime back from Python 2.6. Other options also welcome.

 This problem:
  1. Is Annoying
  2. Has always existed in newforms, and probably in oldforms before that
  3. Only affects a subset of the user community

 Since the required fix will be quite big, and we're already overdue for
 v1.1, I'm going to drop this from the v1.1 roadmap. If someone wants to
 tackle porting strptime and strftime (and this includes resolving any
 licensing issues) and they can get a patch ready quickly, feel free to put
 this back on the v1.1 path.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9459#comment:4>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to