Ticket #6501: force_unicode.patch
File force_unicode.patch, 800 bytes (added by , 17 years ago) |
---|
-
utils/encoding.py
1 1 import types 2 2 import urllib 3 3 import datetime 4 import decimal 4 5 5 6 from django.utils.functional import Promise 6 7 from django.utils.safestring import SafeData, mark_safe … … 43 44 44 45 If strings_only is True, don't convert (some) non-string-like objects. 45 46 """ 46 if strings_only and isinstance(s, (types.NoneType, int, long, datetime.datetime, datetime.date, datetime.time, float )):47 if strings_only and isinstance(s, (types.NoneType, int, long, datetime.datetime, datetime.date, datetime.time, float, decimal.Decimal)): 47 48 return s 48 49 try: 49 50 if not isinstance(s, basestring,):