aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/utils/representation.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/representation.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/representation.py')
-rw-r--r--rest_framework/utils/representation.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/rest_framework/utils/representation.py b/rest_framework/utils/representation.py
index 3f17a8b9..1bfc64c1 100644
--- a/rest_framework/utils/representation.py
+++ b/rest_framework/utils/representation.py
@@ -2,9 +2,11 @@
Helper functions for creating user-friendly representations
of serializer classes and serializer fields.
"""
+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
@@ -24,7 +26,7 @@ def smart_repr(value):
if isinstance(value, Promise) and value._delegate_text:
value = force_text(value)
- value = repr(value)
+ value = unicode_repr(value)
# Representations like u'help text'
# should simply be presented as 'help text'