Ticket #17501: fix.patch

File fix.patch, 867 bytes (added by anonymous, 13 years ago)
  • core/serializers/json.py

    diff --git a/core/serializers/json.py b/core/serializers/json.py
    index 7b570f3..24ea243 100644
    a b from django.core.serializers.python import Serializer as PythonSerializer  
    1010from django.core.serializers.python import Deserializer as PythonDeserializer
    1111from django.utils import simplejson
    1212from django.utils.timezone import is_aware
     13from django.utils.functional import Promise
     14from django.utils.encoding import force_unicode
    1315
    1416class Serializer(PythonSerializer):
    1517    """
    class DjangoJSONEncoder(simplejson.JSONEncoder):  
    6264            return r
    6365        elif isinstance(o, decimal.Decimal):
    6466            return str(o)
     67        elif isinstance(o, Promise):
     68            return force_unicode(o)
    6569        else:
    6670            return super(DjangoJSONEncoder, self).default(o)
    6771
Back to Top