37 lines
1.0 KiB
Python
37 lines
1.0 KiB
Python
from django.contrib.auth.mixins import LoginRequiredMixin
|
|
from mixins.views import ObjectCreate, ObjectDelete, ObjectList, ObjectUpdate
|
|
from two_factor.views.mixins import OTPRequiredMixin
|
|
|
|
from core.forms import LinkGroupForm
|
|
from core.models import LinkGroup
|
|
|
|
|
|
class LinkGroupList(LoginRequiredMixin, OTPRequiredMixin, ObjectList):
|
|
list_template = "partials/linkgroup-list.html"
|
|
model = LinkGroup
|
|
page_title = "List of link groups"
|
|
page_subtitle = "Link groups are used to link aggregators and platforms"
|
|
|
|
list_url_name = "linkgroups"
|
|
list_url_args = ["type"]
|
|
|
|
submit_url_name = "linkgroup_create"
|
|
|
|
|
|
class LinkGroupCreate(LoginRequiredMixin, OTPRequiredMixin, ObjectCreate):
|
|
model = LinkGroup
|
|
form_class = LinkGroupForm
|
|
|
|
submit_url_name = "linkgroup_create"
|
|
|
|
|
|
class LinkGroupUpdate(LoginRequiredMixin, OTPRequiredMixin, ObjectUpdate):
|
|
model = LinkGroup
|
|
form_class = LinkGroupForm
|
|
|
|
submit_url_name = "linkgroup_update"
|
|
|
|
|
|
class LinkGroupDelete(LoginRequiredMixin, OTPRequiredMixin, ObjectDelete):
|
|
model = LinkGroup
|