aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/serializers.py
diff options
context:
space:
mode:
authorTom Christie2014-12-15 12:18:55 +0000
committerTom Christie2014-12-15 12:18:55 +0000
commitb6ee784240b3c7f6cd62af5b6fe6d1014d7bf6d4 (patch)
treee3cdb5a6e210e5ba26d6726cc08a44c8f450776b /rest_framework/serializers.py
parent8934e61b67e4aed38b04f2fe18f011ecbf9010cb (diff)
parentaf53e34dd5873f3373e9991c3825e70d92432e14 (diff)
downloaddjango-rest-framework-b6ee784240b3c7f6cd62af5b6fe6d1014d7bf6d4.tar.bz2
Merge master
Diffstat (limited to 'rest_framework/serializers.py')
-rw-r--r--rest_framework/serializers.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py
index 5adbca3b..e9860a2f 100644
--- a/rest_framework/serializers.py
+++ b/rest_framework/serializers.py
@@ -10,12 +10,11 @@ python primitives.
2. The process of marshalling between python primitives and request and
response content is handled by parsers and renderers.
"""
-import warnings
-
+from __future__ import unicode_literals
from django.db import models
from django.db.models.fields import FieldDoesNotExist
from django.utils.translation import ugettext_lazy as _
-
+from rest_framework.compat import unicode_to_repr
from rest_framework.utils import model_meta
from rest_framework.utils.field_mapping import (
get_url_kwargs, get_field_kwargs,
@@ -29,6 +28,7 @@ from rest_framework.validators import (
UniqueForDateValidator, UniqueForMonthValidator, UniqueForYearValidator,
UniqueTogetherValidator
)
+import warnings
# Note: We do the following so that users of the framework can use this style:
@@ -396,7 +396,7 @@ class Serializer(BaseSerializer):
return attrs
def __repr__(self):
- return representation.serializer_repr(self, indent=1)
+ return unicode_to_repr(representation.serializer_repr(self, indent=1))
# The following are used for accessing `BoundField` instances on the
# serializer, for the purposes of presenting a form-like API onto the
@@ -564,7 +564,7 @@ class ListSerializer(BaseSerializer):
return self.instance
def __repr__(self):
- return representation.list_repr(self, indent=1)
+ return unicode_to_repr(representation.list_repr(self, indent=1))
# Include a backlink to the serializer class on return objects.
# Allows renderers such as HTMLFormRenderer to get the full field info.