Some widgets only take into input unicode strings (when coming from POST data), whereas they can output str strings (in Python 2.7, DatetimeWidget.data_from_value_dict uses datetime.datetime.strftime which returns a str (not unicode). This value is ignored in DatetimeWidget.render because it's not a unicode - and should not have to)
So the functionality was broken only in Python 2.7.
Replaced six.text_type (unicode in 2.7 and str in 3.3) with six.string_types (basestring in 2.7 and str in 3.3)
Some widgets only take into input
unicode
strings (when coming from POST data), whereas they can outputstr
strings (in Python 2.7,DatetimeWidget.data_from_value_dict
usesdatetime.datetime.strftime
which returns astr
(notunicode
). This value is ignored inDatetimeWidget.render
because it's not aunicode
- and should not have to) So the functionality was broken only in Python 2.7. Replacedsix.text_type
(unicode
in 2.7 andstr
in 3.3) withsix.string_types
(basestring
in 2.7 andstr
in 3.3)