56 lines
1.3 KiB
Python
56 lines
1.3 KiB
Python
from django.contrib import admin
|
|
from unfold.admin import ModelAdmin
|
|
|
|
from core.apps.payment.models import PaymentModel
|
|
|
|
|
|
@admin.register(PaymentModel)
|
|
class PaymentAdmin(ModelAdmin):
|
|
list_display = (
|
|
"id",
|
|
"valuation",
|
|
"payer",
|
|
"amount",
|
|
"payment_method",
|
|
"status",
|
|
"transaction_id",
|
|
"paid_at",
|
|
"created_at",
|
|
)
|
|
list_filter = (
|
|
"status",
|
|
"payment_method",
|
|
)
|
|
search_fields = (
|
|
"transaction_id",
|
|
"valuation__conclusion_number",
|
|
"payer__phone",
|
|
"payer__first_name",
|
|
"note",
|
|
)
|
|
readonly_fields = ("created_at", "updated_at")
|
|
raw_id_fields = ("valuation", "payer")
|
|
fieldsets = (
|
|
("To'lov ma'lumotlari", {
|
|
"fields": (
|
|
"valuation",
|
|
"payer",
|
|
("amount", "payment_method"),
|
|
"status",
|
|
),
|
|
}),
|
|
("Tranzaksiya", {
|
|
"fields": (
|
|
"transaction_id",
|
|
"paid_at",
|
|
),
|
|
}),
|
|
("Qo'shimcha", {
|
|
"fields": ("note",),
|
|
}),
|
|
("Tizim", {
|
|
"classes": ("collapse",),
|
|
"fields": ("created_at", "updated_at"),
|
|
}),
|
|
)
|