2023-03-17 18:37:38 +00:00
|
|
|
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 WalletForm
|
|
|
|
from core.models import Wallet
|
|
|
|
|
|
|
|
|
|
|
|
class WalletList(LoginRequiredMixin, OTPRequiredMixin, ObjectList):
|
|
|
|
list_template = "partials/wallet-list.html"
|
|
|
|
model = Wallet
|
2023-03-18 10:48:07 +00:00
|
|
|
page_title = "List of wallets to send profit to"
|
2023-03-17 18:37:38 +00:00
|
|
|
|
|
|
|
list_url_name = "wallets"
|
|
|
|
list_url_args = ["type"]
|
|
|
|
|
|
|
|
submit_url_name = "wallet_create"
|
|
|
|
|
|
|
|
|
|
|
|
class WalletCreate(LoginRequiredMixin, OTPRequiredMixin, ObjectCreate):
|
|
|
|
model = Wallet
|
|
|
|
form_class = WalletForm
|
|
|
|
|
|
|
|
submit_url_name = "wallet_create"
|
|
|
|
|
|
|
|
|
|
|
|
class WalletUpdate(LoginRequiredMixin, OTPRequiredMixin, ObjectUpdate):
|
|
|
|
model = Wallet
|
|
|
|
form_class = WalletForm
|
|
|
|
|
|
|
|
submit_url_name = "wallet_update"
|
|
|
|
|
|
|
|
|
|
|
|
class WalletDelete(LoginRequiredMixin, OTPRequiredMixin, ObjectDelete):
|
|
|
|
model = Wallet
|