2020-05-31 12:08:26 +00:00
|
|
|
from django.views.generic import TemplateView, ListView, CreateView, FormView, DeleteView, UpdateView
|
2020-06-03 15:05:18 +00:00
|
|
|
|
2020-05-21 12:54:59 +00:00
|
|
|
from core.mixins.auth import AdminMixin
|
|
|
|
|
2020-06-09 04:20:14 +00:00
|
|
|
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):
|
2020-05-21 12:54:59 +00:00
|
|
|
pass
|
|
|
|
|
2020-06-09 04:20:14 +00:00
|
|
|
class BackendListView(BackendViewMixin, ListView):
|
2020-05-21 12:54:59 +00:00
|
|
|
pass
|
|
|
|
|
2020-06-09 04:20:14 +00:00
|
|
|
class BackendCreateView(BackendViewMixin, CreateView):
|
2020-05-21 12:54:59 +00:00
|
|
|
pass
|
|
|
|
|
2020-06-09 04:20:14 +00:00
|
|
|
class BackendFormView(BackendViewMixin, FormView):
|
2020-05-21 12:54:59 +00:00
|
|
|
pass
|
|
|
|
|
2020-06-09 04:20:14 +00:00
|
|
|
class BackendDeleteView(BackendViewMixin, DeleteView):
|
2020-05-31 12:08:26 +00:00
|
|
|
pass
|
|
|
|
|
2020-06-09 04:20:14 +00:00
|
|
|
class BackendUpdateView(BackendViewMixin, UpdateView):
|
2020-05-21 12:54:59 +00:00
|
|
|
pass
|