Begin adding platform support
This commit is contained in:
50
core/views/platforms.py
Normal file
50
core/views/platforms.py
Normal file
@@ -0,0 +1,50 @@
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from django.http import HttpResponse
|
||||
from django.shortcuts import render
|
||||
from django.urls import reverse
|
||||
from django.views import View
|
||||
from mixins.views import ( # ObjectRead,
|
||||
ObjectCreate,
|
||||
ObjectDelete,
|
||||
ObjectList,
|
||||
ObjectUpdate,
|
||||
)
|
||||
from two_factor.views.mixins import OTPRequiredMixin
|
||||
|
||||
# from core.clients.platforms.agora import AgoraClient
|
||||
from core.forms import PlatformForm
|
||||
from core.models import Platform
|
||||
from core.util import logs
|
||||
|
||||
# from core.views.helpers import synchronize_async_helper
|
||||
|
||||
log = logs.get_logger(__name__)
|
||||
|
||||
|
||||
class PlatformList(LoginRequiredMixin, OTPRequiredMixin, ObjectList):
|
||||
list_template = "partials/platform-list.html"
|
||||
model = Platform
|
||||
page_title = "List of platform connections"
|
||||
|
||||
list_url_name = "platforms"
|
||||
list_url_args = ["type"]
|
||||
|
||||
submit_url_name = "platform_create"
|
||||
|
||||
|
||||
class PlatformCreate(LoginRequiredMixin, OTPRequiredMixin, ObjectCreate):
|
||||
model = Platform
|
||||
form_class = PlatformForm
|
||||
|
||||
submit_url_name = "platform_create"
|
||||
|
||||
|
||||
class PlatformUpdate(LoginRequiredMixin, OTPRequiredMixin, ObjectUpdate):
|
||||
model = Platform
|
||||
form_class = PlatformForm
|
||||
|
||||
submit_url_name = "platform_update"
|
||||
|
||||
|
||||
class PlatformDelete(LoginRequiredMixin, OTPRequiredMixin, ObjectDelete):
|
||||
model = Platform
|
||||
Reference in New Issue
Block a user