From 72e08a3e8b6427cb93f0f98b42724e31e5b3d8f9 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Mon, 15 Dec 2014 11:55:17 +0000 Subject: Use unicode internally everywhere for 'repr' --- rest_framework/utils/serializer_helpers.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'rest_framework/utils/serializer_helpers.py') 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): -- cgit v1.2.3