aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/utils/breadcrumbs.py
diff options
context:
space:
mode:
authorTom Christie2013-04-04 21:42:26 +0100
committerTom Christie2013-04-04 21:42:26 +0100
commitf68721ade8d66806296323116ff9a61773ad2be1 (patch)
treed9f44f935ad338f7accb9500383c15bf30bc3621 /rest_framework/utils/breadcrumbs.py
parent9e24db022cd8da1a588dd43e6239e07798881c02 (diff)
downloaddjango-rest-framework-f68721ade8d66806296323116ff9a61773ad2be1.tar.bz2
Factor view names/descriptions out of View class
Diffstat (limited to 'rest_framework/utils/breadcrumbs.py')
-rw-r--r--rest_framework/utils/breadcrumbs.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/rest_framework/utils/breadcrumbs.py b/rest_framework/utils/breadcrumbs.py
index af21ac79..18b3b207 100644
--- a/rest_framework/utils/breadcrumbs.py
+++ b/rest_framework/utils/breadcrumbs.py
@@ -1,5 +1,6 @@
from __future__ import unicode_literals
from django.core.urlresolvers import resolve, get_script_prefix
+from rest_framework.utils.formatting import get_view_name
def get_breadcrumbs(url):
@@ -16,11 +17,11 @@ def get_breadcrumbs(url):
pass
else:
# Check if this is a REST framework view, and if so add it to the breadcrumbs
- if isinstance(getattr(view, 'cls_instance', None), APIView):
+ if issubclass(getattr(view, 'cls', None), APIView):
# Don't list the same view twice in a row.
# Probably an optional trailing slash.
if not seen or seen[-1] != view:
- breadcrumbs_list.insert(0, (view.cls_instance.get_name(), prefix + url))
+ breadcrumbs_list.insert(0, (get_view_name(view.cls), prefix + url))
seen.append(view)
if url == '':