From b7687fae2d04c3cee88b0c707f9f2c2176e3f515 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Sat, 20 Oct 2007 13:01:09 +0000 Subject: [PATCH] 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 --- django/utils/encoding.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/utils/encoding.py b/django/utils/encoding.py index 6daae4386d..2bd1ef6563 100644 --- a/django/utils/encoding.py +++ b/django/utils/encoding.py @@ -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__'):