2023-03-07 16:59:39 +00:00
|
|
|
from django.contrib.auth.mixins import LoginRequiredMixin
|
2023-03-07 17:00:01 +00:00
|
|
|
from mixins.views import ( # ObjectRead,
|
2023-03-07 16:59:39 +00:00
|
|
|
ObjectCreate,
|
|
|
|
ObjectDelete,
|
|
|
|
ObjectList,
|
|
|
|
ObjectUpdate,
|
|
|
|
)
|
|
|
|
from two_factor.views.mixins import OTPRequiredMixin
|
|
|
|
|
|
|
|
from core.forms import AggregatorForm
|
|
|
|
from core.models import Aggregator
|
|
|
|
from core.util import logs
|
|
|
|
|
|
|
|
log = logs.get_logger(__name__)
|
|
|
|
|
|
|
|
|
|
|
|
class AggregatorList(LoginRequiredMixin, OTPRequiredMixin, ObjectList):
|
|
|
|
list_template = "partials/aggregator-list.html"
|
|
|
|
model = Aggregator
|
|
|
|
page_title = "List of aggregator connections"
|
|
|
|
|
|
|
|
list_url_name = "aggregators"
|
|
|
|
list_url_args = ["type"]
|
|
|
|
|
|
|
|
submit_url_name = "aggregator_create"
|
|
|
|
|
|
|
|
|
|
|
|
class AggregatorCreate(LoginRequiredMixin, OTPRequiredMixin, ObjectCreate):
|
|
|
|
model = Aggregator
|
|
|
|
form_class = AggregatorForm
|
|
|
|
|
|
|
|
submit_url_name = "aggregator_create"
|
|
|
|
|
|
|
|
|
|
|
|
class AggregatorUpdate(LoginRequiredMixin, OTPRequiredMixin, ObjectUpdate):
|
|
|
|
model = Aggregator
|
|
|
|
form_class = AggregatorForm
|
|
|
|
|
|
|
|
submit_url_name = "aggregator_update"
|
|
|
|
|
|
|
|
|
|
|
|
class AggregatorDelete(LoginRequiredMixin, OTPRequiredMixin, ObjectDelete):
|
|
|
|
model = Aggregator
|