38 lines
879 B
Python
38 lines
879 B
Python
from django.contrib.auth.mixins import LoginRequiredMixin
|
|
|
|
from core.forms import RiskForm
|
|
from core.models import Risk
|
|
from core.util import logs
|
|
from core.views import ObjectCreate, ObjectDelete, ObjectList, ObjectUpdate
|
|
|
|
log = logs.get_logger(__name__)
|
|
|
|
|
|
class RiskList(LoginRequiredMixin, ObjectList):
|
|
list_template = "partials/signal-list.html"
|
|
model = Risk
|
|
page_title = "List of risk management strategies. Linked to accounts."
|
|
|
|
list_url_name = "risk"
|
|
list_url_args = ["type"]
|
|
|
|
submit_url_name = "risk_create"
|
|
|
|
|
|
class RiskCreate(LoginRequiredMixin, ObjectCreate):
|
|
model = Risk
|
|
form_class = RiskForm
|
|
|
|
submit_url_name = "risk_create"
|
|
|
|
|
|
class RiskUpdate(LoginRequiredMixin, ObjectUpdate):
|
|
model = Risk
|
|
form_class = RiskForm
|
|
|
|
submit_url_name = "risk_update"
|
|
|
|
|
|
class RiskDelete(LoginRequiredMixin, ObjectDelete):
|
|
model = Risk
|