Implement wallet model and CRUD
This commit is contained in:
35
core/views/wallets.py
Normal file
35
core/views/wallets.py
Normal file
@@ -0,0 +1,35 @@
|
||||
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
|
||||
page_title = "List of wallets"
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user