expephalon/core/views/backend/generic.py
Klaus-Uwe Mitterer fb02819e36 Improved currency display
Implemented RedirectViews
Changed URL scheme for submodules
Updated kumisms and ratesapi submodules
2020-06-10 13:43:14 +02:00

34 lines
No EOL
893 B
Python

from django.views.generic import TemplateView, ListView, CreateView, FormView, DeleteView, UpdateView
from core.mixins.auth import AdminMixin
from core.views.generic import RedirectView
class BackendViewMixin(AdminMixin):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
try:
context["title"] = self.title
except AttributeError:
pass
return context
class BackendTemplateView(BackendViewMixin, TemplateView):
pass
class BackendListView(BackendViewMixin, ListView):
pass
class BackendCreateView(BackendViewMixin, CreateView):
pass
class BackendFormView(BackendViewMixin, FormView):
pass
class BackendDeleteView(BackendViewMixin, DeleteView):
pass
class BackendUpdateView(BackendViewMixin, UpdateView):
pass
class BackendRedirectView(AdminMixin, RedirectView):
pass