38 lines
1.1 KiB
Python
38 lines
1.1 KiB
Python
from django.contrib.auth.mixins import LoginRequiredMixin
|
|
from mixins.views import ObjectCreate, ObjectDelete, ObjectList, ObjectUpdate
|
|
|
|
from core.forms import ActiveManagementPolicyForm
|
|
from core.models import ActiveManagementPolicy
|
|
from core.util import logs
|
|
|
|
log = logs.get_logger(__name__)
|
|
|
|
|
|
class ActiveManagementPolicyList(LoginRequiredMixin, ObjectList):
|
|
list_template = "partials/activemanagement-list.html"
|
|
model = ActiveManagementPolicy
|
|
page_title = "List of active management policies. Linked to strategies."
|
|
|
|
list_url_name = "ams"
|
|
list_url_args = ["type"]
|
|
|
|
submit_url_name = "ams_create"
|
|
|
|
|
|
class ActiveManagementPolicyCreate(LoginRequiredMixin, ObjectCreate):
|
|
model = ActiveManagementPolicy
|
|
form_class = ActiveManagementPolicyForm
|
|
|
|
submit_url_name = "ams_create"
|
|
|
|
|
|
class ActiveManagementPolicyUpdate(LoginRequiredMixin, ObjectUpdate):
|
|
model = ActiveManagementPolicy
|
|
form_class = ActiveManagementPolicyForm
|
|
|
|
submit_url_name = "ams_update"
|
|
|
|
|
|
class ActiveManagementPolicyDelete(LoginRequiredMixin, ObjectDelete):
|
|
model = ActiveManagementPolicy
|