diff options
| author | Tom Christie | 2013-04-04 21:42:26 +0100 |
|---|---|---|
| committer | Tom Christie | 2013-04-04 21:42:26 +0100 |
| commit | f68721ade8d66806296323116ff9a61773ad2be1 (patch) | |
| tree | d9f44f935ad338f7accb9500383c15bf30bc3621 /rest_framework/utils/breadcrumbs.py | |
| parent | 9e24db022cd8da1a588dd43e6239e07798881c02 (diff) | |
| download | django-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.py | 5 |
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 == '': |
