74 lines
1.9 KiB
Python
74 lines
1.9 KiB
Python
from django.contrib import admin
|
|
from manage_wallets import models
|
|
|
|
# Register your models here.
|
|
|
|
|
|
class WalletAdmin(admin.ModelAdmin):
|
|
list_display = (
|
|
"id",
|
|
"principal",
|
|
"coins",
|
|
"balance",
|
|
"deposit",
|
|
"withdrawal_balance",
|
|
"active",
|
|
"deleted",
|
|
"created_on",
|
|
"modified_on",
|
|
"created_by",
|
|
"modified_by",
|
|
)
|
|
list_filter = ("principal",) # You can filter the list by other fields if needed
|
|
search_fields = (
|
|
"principal__username",
|
|
) # Example search field (replace with the relevant field)
|
|
|
|
|
|
admin.site.register(models.Wallet, WalletAdmin)
|
|
|
|
|
|
# class TransactionAdmin(admin.ModelAdmin):
|
|
# list_display = ('principal', 'principal_type', 'transaction_type', 'transaction_status', 'amount', 'active', 'deleted', 'created_on', 'modified_on', 'created_by', 'modified_by')
|
|
# list_filter = ('principal', 'transaction_type', 'transaction_status')
|
|
# search_fields = ('principal__username',)
|
|
# admin.site.register(models.Transaction, TransactionAdmin)
|
|
|
|
|
|
@admin.register(models.Transaction)
|
|
class TransactionAdmin(admin.ModelAdmin):
|
|
list_display = (
|
|
"id",
|
|
"principal",
|
|
"transaction_type",
|
|
"transaction_status",
|
|
"amount",
|
|
"comment",
|
|
"order_id",
|
|
"product_id",
|
|
"reference_id",
|
|
"payment_method",
|
|
"principal_subscription",
|
|
"active",
|
|
"deleted",
|
|
"created_on",
|
|
"modified_on",
|
|
"created_by",
|
|
"modified_by",
|
|
)
|
|
list_filter = ("transaction_type", "transaction_status")
|
|
search_fields = ["order_id"]
|
|
|
|
|
|
@admin.register(models.StripeConnectAccount)
|
|
class StripeConnectAccountAdmin(admin.ModelAdmin):
|
|
list_display = (
|
|
"id",
|
|
"principal",
|
|
"stripe_connect_id",
|
|
"charges_enabled",
|
|
"transfers_enabled",
|
|
"details_submitted",
|
|
)
|
|
search_fields = ("principal__name", "stripe_connect_id")
|