expephalon-demomodule/core/views/dbsettings.py

31 lines
1 KiB
Python
Raw Normal View History

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):
2020-04-15 20:43:40 +00:00
template_name = f"{settings.EXPEPHALON_BACKEND}/dbsettings/index.html"
model = Setting
class DBSettingsEditView(UpdateView):
2020-04-15 20:43:40 +00:00
template_name = f"{settings.EXPEPHALON_BACKEND}/dbsettings/update.html"
model = Setting
success_url = reverse_lazy("dbsettings")
fields = ["key", "value"]
class DBSettingsDeleteView(DeleteView):
2020-04-15 20:43:40 +00:00
template_name = f"{settings.EXPEPHALON_BACKEND}/dbsettings/delete.html"
model = Setting
success_url = reverse_lazy("dbsettings")
class DBSettingsCreateView(CreateView):
2020-04-15 20:43:40 +00:00
template_name = f"{settings.EXPEPHALON_BACKEND}/dbsettings/create.html"
model = Setting
success_url = reverse_lazy("dbsettings")
fields = ["key", "value"]
except ModuleNotFoundError:
pass