fisk/core/views/signals.py

50 lines
1.2 KiB
Python

from django.contrib.auth.mixins import LoginRequiredMixin
from core.forms import SignalForm
from core.models import Signal
from core.util import logs
from core.views import ObjectCreate, ObjectDelete, ObjectList, ObjectUpdate
log = logs.get_logger(__name__)
class SignalList(LoginRequiredMixin, ObjectList):
list_template = "partials/signal-list.html"
model = Signal
page_title = "List of signals. Linked to hooks and strategies."
page_subtitle = (
"Link signals you have defined in Drakdoo to their corresponding hooks."
)
list_url_name = "signals"
list_url_args = ["type"]
submit_url_name = "signal_create"
class SignalCreate(LoginRequiredMixin, ObjectCreate):
model = Signal
form_class = SignalForm
list_url_name = "signals"
list_url_args = ["type"]
submit_url_name = "signal_create"
class SignalUpdate(LoginRequiredMixin, ObjectUpdate):
model = Signal
form_class = SignalForm
list_url_name = "signals"
list_url_args = ["type"]
submit_url_name = "signal_update"
class SignalDelete(LoginRequiredMixin, ObjectDelete):
model = Signal
list_url_name = "signals"
list_url_args = ["type"]