# Imports
from superdjango.html.library import Breadcrumbs
# Exports
__all__ = (
"BreadcrumbsMixin",
)
# Mixins
[docs]class BreadcrumbsMixin(object):
"""A view mixin which incorporates breadcrumbs into the template context."""
# noinspection PyMethodMayBeStatic
[docs] def get_breadcrumbs(self):
"""Get the breadcrumbs for the view.
:rtype: Breadcrumbs
"""
return Breadcrumbs()
[docs] def get_context_data(self, **kwargs):
"""Add ``breadcrumbs`` to the context."""
# noinspection PyUnresolvedReferences
context = super().get_context_data(**kwargs)
context['breadcrumbs'] = self.get_breadcrumbs()
return context