aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/utils/serializer_helpers.py
diff options
context:
space:
mode:
authorTom Christie2014-12-15 12:04:46 +0000
committerTom Christie2014-12-15 12:04:46 +0000
commitaf53e34dd5873f3373e9991c3825e70d92432e14 (patch)
treef5503776ef204ff125f476116b11ca0801fd3b8e /rest_framework/utils/serializer_helpers.py
parent1f6fd924fea05b9b7eb4bedf44dfdcb2f14c5cad (diff)
parentdc66cce16da6793efe4a4a4dcdd18db62c859abb (diff)
downloaddjango-rest-framework-af53e34dd5873f3373e9991c3825e70d92432e14.tar.bz2
Merge pull request #2279 from tomchristie/fix-serializer-repr-unicode-bug
Use unicode internally everywhere for 'repr'.
Diffstat (limited to 'rest_framework/utils/serializer_helpers.py')
-rw-r--r--rest_framework/utils/serializer_helpers.py7
1 files changed, 4 insertions, 3 deletions
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):