aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/utils/breadcrumbs.py
diff options
context:
space:
mode:
authorChristopher Paolini2013-08-17 17:44:51 -0400
committerChristopher Paolini2013-08-17 17:44:51 -0400
commite6662d434f0214d21d38e4388a40fd63e1f9dcc6 (patch)
tree9da7194df8987b9f1bf194089bfea5be8cac55a7 /rest_framework/utils/breadcrumbs.py
parenta95984e4d4b034c196d40f74fbdc6345e6d4124c (diff)
downloaddjango-rest-framework-e6662d434f0214d21d38e4388a40fd63e1f9dcc6.tar.bz2
Improved view/description function setting
Now supports each View having its own name and description function and overriding the global default.
Diffstat (limited to 'rest_framework/utils/breadcrumbs.py')
-rw-r--r--rest_framework/utils/breadcrumbs.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/rest_framework/utils/breadcrumbs.py b/rest_framework/utils/breadcrumbs.py
index d51374b0..0384faba 100644
--- a/rest_framework/utils/breadcrumbs.py
+++ b/rest_framework/utils/breadcrumbs.py
@@ -1,6 +1,5 @@
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):
@@ -29,8 +28,8 @@ def get_breadcrumbs(url):
# Don't list the same view twice in a row.
# Probably an optional trailing slash.
if not seen or seen[-1] != view:
- suffix = getattr(view, 'suffix', None)
- name = get_view_name(view.cls, suffix)
+ instance = view.cls()
+ name = instance.get_view_name()
breadcrumbs_list.insert(0, (name, prefix + url))
seen.append(view)