#17165: SelectDateWidget does not work correctly with has_changed()
-------------------------------------+-------------------------------------
     Reporter:  rene@…               |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Forms                |                  Version:  SVN
     Severity:  Normal               |               Resolution:  fixed
     Keywords:  SelectDateWidget     |             Triage Stage:  Accepted
  changed has_changed changed_data   |      Needs documentation:  0
    Has patch:  1                    |  Patch needs improvement:  1
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------
Changes (by fon.vosi@…):

 * needs_better_patch:  0 => 1


Comment:

 doesn't work for me
 when SelectDateWidget is empty and i check "if 'fieldname' in
 self.changed_data" for some other field
 django fires TypeError "must be string, not None" in
 django/forms/extras/widgets.py "data =
 datetime_safe.datetime.strptime(data, input_format).date()"

 so, you should make something like

 if data is not None:
   data = datetime_safe.datetime.strptime(data, input_format).date()
 else:
   data = None

-- 
Ticket URL: <https://code.djangoproject.com/ticket/17165#comment:10>
Django <https://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