expephalon-demomodule/core/views/dbsettings.py
Klaus-Uwe Mitterer 7708128255 Finally got all the OTP stuff working
Finalized dbsettings views
Easter egg for missing backend pages
2020-04-15 22:19:03 +02:00

30 lines
1 KiB
Python

from django.conf import settings
from django.views.generic import ListView, UpdateView, DeleteView, CreateView
from django.urls import reverse_lazy
try:
from dbsettings.models import Setting
class DBSettingsListView(ListView):
template_name = f"{settings.EXPEPHALON_BACKEND}/dbsettings.html"
model = Setting
class DBSettingsEditView(UpdateView):
template_name = f"{settings.EXPEPHALON_BACKEND}/dbsettings_update.html"
model = Setting
success_url = reverse_lazy("dbsettings")
fields = ["key", "value"]
class DBSettingsDeleteView(DeleteView):
template_name = f"{settings.EXPEPHALON_BACKEND}/dbsettings_delete.html"
model = Setting
success_url = reverse_lazy("dbsettings")
class DBSettingsCreateView(CreateView):
template_name = f"{settings.EXPEPHALON_BACKEND}/dbsettings_create.html"
model = Setting
success_url = reverse_lazy("dbsettings")
fields = ["key", "value"]
except ModuleNotFoundError:
pass