diff options
Diffstat (limited to 'rest_framework/utils')
| -rw-r--r-- | rest_framework/utils/representation.py | 3 | ||||
| -rw-r--r-- | rest_framework/utils/serializer_helpers.py | 7 | 
2 files changed, 6 insertions, 4 deletions
| diff --git a/rest_framework/utils/representation.py b/rest_framework/utils/representation.py index 0fdb4775..1bfc64c1 100644 --- a/rest_framework/utils/representation.py +++ b/rest_framework/utils/representation.py @@ -6,6 +6,7 @@ from __future__ import unicode_literals  from django.db import models  from django.utils.encoding import force_text  from django.utils.functional import Promise +from rest_framework.compat import unicode_repr  import re @@ -25,7 +26,7 @@ def smart_repr(value):      if isinstance(value, Promise) and value._delegate_text:          value = force_text(value) -    value = repr(value).decode('utf-8') +    value = unicode_repr(value)      # Representations like u'help text'      # should simply be presented as 'help text' diff --git a/rest_framework/utils/serializer_helpers.py b/rest_framework/utils/serializer_helpers.py index 277cf649..65a04d06 100644 --- a/rest_framework/utils/serializer_helpers.py +++ b/rest_framework/utils/serializer_helpers.py @@ -1,5 +1,6 @@ +from __future__ import unicode_literals  import collections -from rest_framework.compat import OrderedDict +from rest_framework.compat import OrderedDict, unicode_to_repr  class ReturnDict(OrderedDict): @@ -47,9 +48,9 @@ class BoundField(object):          return self._field.__class__      def __repr__(self): -        return '<%s value=%s errors=%s>' % ( +        return unicode_to_repr('<%s value=%s errors=%s>' % (              self.__class__.__name__, self.value, self.errors -        ) +        ))  class NestedBoundField(BoundField): | 
