aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/views.py
diff options
context:
space:
mode:
authorTom Christie2013-02-22 19:48:25 +0000
committerTom Christie2013-02-22 19:48:25 +0000
commit78da724964019e33bfa5d9f05db2806d85816c2d (patch)
treeafb8c1b3fb18fba9af370e7afffd7458d730d7c3 /rest_framework/views.py
parent569c3a28e662ccef251acc6494047ec9c83556c2 (diff)
parenta39de47cc7e6861a1d06b8ab1893f7358cf281f9 (diff)
downloaddjango-rest-framework-78da724964019e33bfa5d9f05db2806d85816c2d.tar.bz2
Merge with master
Diffstat (limited to 'rest_framework/views.py')
-rw-r--r--rest_framework/views.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/rest_framework/views.py b/rest_framework/views.py
index fa742582..a3a3ac25 100644
--- a/rest_framework/views.py
+++ b/rest_framework/views.py
@@ -4,6 +4,7 @@ Provides an APIView class that is used as the base of all class-based views.
from __future__ import unicode_literals
from django.core.exceptions import PermissionDenied
from django.http import Http404
+from django.utils.encoding import force_unicode
from django.utils.html import escape
from django.utils.safestring import mark_safe
from django.views.decorators.csrf import csrf_exempt
@@ -96,7 +97,7 @@ class APIView(View):
Override to customize.
"""
# TODO: deprecate?
- name = self.__class__.__name__
+ name = force_unicode(self.__class__.__name__)
name = _remove_trailing_string(name, 'View')
return _camelcase_to_spaces(name)
@@ -106,7 +107,7 @@ class APIView(View):
Override to customize.
"""
# TODO: deprecate?
- description = self.__doc__ or ''
+ description = force_unicode(self.__doc__) or u''
description = _remove_leading_indent(description)
if html:
return self.markup_description(description)