Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# Imports
3from superdjango.html.library import Breadcrumbs
5# Exports
7__all__ = (
8 "BreadcrumbsMixin",
9)
11# Mixins
14class BreadcrumbsMixin(object):
15 """A view mixin which incorporates breadcrumbs into the template context."""
17 # noinspection PyMethodMayBeStatic
18 def get_breadcrumbs(self):
19 """Get the breadcrumbs for the view.
21 :rtype: Breadcrumbs
23 """
24 return Breadcrumbs()
26 def get_context_data(self, **kwargs):
27 """Add ``breadcrumbs`` to the context."""
28 # noinspection PyUnresolvedReferences
29 context = super().get_context_data(**kwargs)
31 context['breadcrumbs'] = self.get_breadcrumbs()
33 return context