Hide keyboard shortcuts

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 

2 

3from superdjango.html.library import Breadcrumbs 

4 

5# Exports 

6 

7__all__ = ( 

8 "BreadcrumbsMixin", 

9) 

10 

11# Mixins 

12 

13 

14class BreadcrumbsMixin(object): 

15 """A view mixin which incorporates breadcrumbs into the template context.""" 

16 

17 # noinspection PyMethodMayBeStatic 

18 def get_breadcrumbs(self): 

19 """Get the breadcrumbs for the view. 

20 

21 :rtype: Breadcrumbs 

22 

23 """ 

24 return Breadcrumbs() 

25 

26 def get_context_data(self, **kwargs): 

27 """Add ``breadcrumbs`` to the context.""" 

28 # noinspection PyUnresolvedReferences 

29 context = super().get_context_data(**kwargs) 

30 

31 context['breadcrumbs'] = self.get_breadcrumbs() 

32 

33 return context