From 8dff8d2fdcfcee356c134f4be8235d2a4f122d1a Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Tue, 30 Apr 2013 14:34:03 +0100 Subject: [PATCH] Add get_breadcrumbs hook to BrowseableAPIRenderer. Closes #733. --- rest_framework/renderers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rest_framework/renderers.py b/rest_framework/renderers.py index a0829c8fc..c457ec732 100644 --- a/rest_framework/renderers.py +++ b/rest_framework/renderers.py @@ -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, {