Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
02b6836e
Commit
02b6836e
authored
Aug 29, 2013
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix breadcrumb view names
parent
556b4bbb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
rest_framework/utils/breadcrumbs.py
+5
-2
No files found.
rest_framework/utils/breadcrumbs.py
View file @
02b6836e
...
...
@@ -8,8 +8,11 @@ def get_breadcrumbs(url):
tuple of (name, url).
"""
from
rest_framework.settings
import
api_settings
from
rest_framework.views
import
APIView
view_name_func
=
api_settings
.
VIEW_NAME_FUNCTION
def
breadcrumbs_recursive
(
url
,
breadcrumbs_list
,
prefix
,
seen
):
"""
Add tuples of (name, url) to the breadcrumbs list,
...
...
@@ -28,8 +31,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
:
instance
=
view
.
cls
(
)
name
=
instance
.
get_view_name
(
)
suffix
=
getattr
(
view
,
'suffix'
,
None
)
name
=
view_name_func
(
cls
,
suffix
)
breadcrumbs_list
.
insert
(
0
,
(
name
,
prefix
+
url
))
seen
.
append
(
view
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment