2022-11-29 07:20:21 +00:00
|
|
|
from django.contrib.auth.mixins import LoginRequiredMixin
|
2023-02-10 20:49:35 +00:00
|
|
|
from mixins.views import ObjectCreate, ObjectDelete, ObjectList, ObjectUpdate
|
2022-11-29 07:20:21 +00:00
|
|
|
|
|
|
|
from core.forms import SignalForm
|
|
|
|
from core.models import Signal
|
|
|
|
from core.util import logs
|
|
|
|
|
|
|
|
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."
|
2022-12-01 19:32:50 +00:00
|
|
|
page_subtitle = (
|
|
|
|
"Link signals you have defined in Drakdoo to their corresponding hooks."
|
|
|
|
)
|
2022-11-29 07:20:21 +00:00
|
|
|
|
|
|
|
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
|