mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-23 15:54:16 +03:00
Add get_breadcrumbs hook to BrowseableAPIRenderer. Closes #733.
This commit is contained in:
parent
455d7cca1e
commit
8dff8d2fdc
|
@ -444,6 +444,9 @@ class BrowsableAPIRenderer(BaseRenderer):
|
|||
def get_description(self, view):
|
||||
return get_view_description(view.__class__, html=True)
|
||||
|
||||
def get_breadcrumbs(self, request):
|
||||
return get_breadcrumbs(request.path)
|
||||
|
||||
def render(self, data, accepted_media_type=None, renderer_context=None):
|
||||
"""
|
||||
Renders *obj* using the :attr:`template` set on the class.
|
||||
|
@ -475,7 +478,7 @@ class BrowsableAPIRenderer(BaseRenderer):
|
|||
|
||||
name = self.get_name(view)
|
||||
description = self.get_description(view)
|
||||
breadcrumb_list = get_breadcrumbs(request.path)
|
||||
breadcrumb_list = self.get_breadcrumbs(request)
|
||||
|
||||
template = loader.get_template(self.template)
|
||||
context = RequestContext(request, {
|
||||
|
|
Loading…
Reference in New Issue
Block a user