Класс ContextMixin (Django 3.2)
from django.views.generic.base import ContextMixin
A default context mixin that passes the keyword arguments received by get_context_data() as the template context.
Diagramm | Documentation | Source code
Потомки
- ArchiveIndexView
- BaseArchiveIndexView
- BaseCreateView
- BaseDateDetailView
- BaseDateListView
- BaseDayArchiveView
- BaseDeleteView
- BaseDetailView
- BaseFormView
- BaseListView
- BaseMonthArchiveView
- BaseTodayArchiveView
- BaseUpdateView
- BaseWeekArchiveView
- BaseYearArchiveView
- CreateView
- DateDetailView
- DayArchiveView
- DeleteView
- DetailView
- FormMixin
- FormView
- ListView
- LoginView
- LogoutView
- ModelFormMixin
- ModelFormMixin
- MonthArchiveView
- MultipleObjectMixin
- PasswordChangeDoneView
- PasswordChangeView
- PasswordResetCompleteView
- PasswordResetConfirmView
- PasswordResetDoneView
- PasswordResetView
- SingleObjectMixin
- TemplateView
- TodayArchiveView
- UpdateView
- WeekArchiveView
- YearArchiveView
Attributes
Defined in | |
---|---|
extra_context = None
|
ContextMixin |
Methods
def get_context_data(self, **kwargs):
kwargs.setdefault('view', self)
if self.extra_context is not None:
kwargs.update(self.extra_context)
return kwargs