You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1014 B
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
submit_url_name = "signal_create"
class SignalUpdate(LoginRequiredMixin, ObjectUpdate):
model = Signal
form_class = SignalForm
submit_url_name = "signal_update"
class SignalDelete(LoginRequiredMixin, ObjectDelete):
model = Signal