NDOJ/judge/views/__init__.py

11 lines
324 B
Python
Raw Permalink Normal View History

2020-01-21 06:35:58 +00:00
from django.views.generic import TemplateView
class TitledTemplateView(TemplateView):
title = None
def get_context_data(self, **kwargs):
2022-05-14 17:57:27 +00:00
if "title" not in kwargs and self.title is not None:
kwargs["title"] = self.title
2020-01-21 06:35:58 +00:00
return super(TitledTemplateView, self).get_context_data(**kwargs)