Begin ad CRUD
This commit is contained in:
48
core/views/ads.py
Normal file
48
core/views/ads.py
Normal file
@@ -0,0 +1,48 @@
|
||||
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
|
||||
Reference in New Issue
Block a user