Everything you wanted to know
about the Django framework

Класс ContextMixin (Django 2.0)

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.

Диаграмма | Documentation | Исходный код

Атрибуты

  Определено в
extra_context = None ContextMixin

Методы

23
24
25
26
27
28
def get_context_data(self, **kwargs):
    if 'view' not in kwargs:
        kwargs['view'] = self
    if self.extra_context is not None:
        kwargs.update(self.extra_context)
    return kwargs