pluto/core/views/ads.py

49 lines
1.2 KiB
Python
Raw Normal View History

2023-03-10 00:42:28 +00:00
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 (
ObjectCreate,
ObjectDelete,
ObjectList,
ObjectRead,
ObjectUpdate,
)
from two_factor.views.mixins import OTPRequiredMixin
from core.clients.platforms.agora import AgoraClient
from core.forms import AdForm
from core.models import Ad
from core.util import logs
from core.views.helpers import synchronize_async_helper
class AdList(LoginRequiredMixin, OTPRequiredMixin, ObjectList):
list_template = "partials/ad-list.html"
model = Ad
page_title = "List of ad connections"
list_url_name = "ads"
list_url_args = ["type"]
submit_url_name = "ad_create"
class AdCreate(LoginRequiredMixin, OTPRequiredMixin, ObjectCreate):
model = Ad
form_class = AdForm
submit_url_name = "ad_create"
class AdUpdate(LoginRequiredMixin, OTPRequiredMixin, ObjectUpdate):
model = Ad
form_class = AdForm
submit_url_name = "ad_update"
class AdDelete(LoginRequiredMixin, OTPRequiredMixin, ObjectDelete):
model = Ad