aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/views.py
diff options
context:
space:
mode:
authorTom Christie2013-02-22 20:18:16 +0000
committerTom Christie2013-02-22 20:18:16 +0000
commit0c7d6062b2b327f1fb4051a898212499e33daa54 (patch)
tree25331a6296f0b75c0329c85228fd99ecbca18818 /rest_framework/views.py
parent09f2bdd21998dd64b38285ee244a760f711793f5 (diff)
downloaddjango-rest-framework-0c7d6062b2b327f1fb4051a898212499e33daa54.tar.bz2
Py3/2 compat fixes for uncode view names/descriptions
Diffstat (limited to 'rest_framework/views.py')
-rw-r--r--rest_framework/views.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/rest_framework/views.py b/rest_framework/views.py
index a3a3ac25..69377bc0 100644
--- a/rest_framework/views.py
+++ b/rest_framework/views.py
@@ -4,12 +4,11 @@ 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
from rest_framework import status, exceptions
-from rest_framework.compat import View, apply_markdown
+from rest_framework.compat import View, apply_markdown, smart_text
from rest_framework.response import Response
from rest_framework.request import Request
from rest_framework.settings import api_settings
@@ -97,7 +96,7 @@ class APIView(View):
Override to customize.
"""
# TODO: deprecate?
- name = force_unicode(self.__class__.__name__)
+ name = self.__class__.__name__
name = _remove_trailing_string(name, 'View')
return _camelcase_to_spaces(name)
@@ -107,7 +106,7 @@ class APIView(View):
Override to customize.
"""
# TODO: deprecate?
- description = force_unicode(self.__doc__) or u''
+ description = self.__doc__ or ''
description = _remove_leading_indent(description)
if html:
return self.markup_description(description)