mirror of https://github.com/django/django.git
Added datetime.date to the things ignored by strings_only in [6406].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6567 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
d1efe9b2f7
commit
b7687fae2d
|
@ -31,7 +31,7 @@ def force_unicode(s, encoding='utf-8', strings_only=False, errors='strict'):
|
|||
|
||||
If strings_only is True, don't convert (some) non-string-like objects.
|
||||
"""
|
||||
if strings_only and isinstance(s, (types.NoneType, int, long, datetime.datetime, datetime.time, float)):
|
||||
if strings_only and isinstance(s, (types.NoneType, int, long, datetime.datetime, datetime.date, datetime.time, float)):
|
||||
return s
|
||||
if not isinstance(s, basestring,):
|
||||
if hasattr(s, '__unicode__'):
|
||||
|
|
Loading…
Reference in New Issue