From 2122e8dfee1b7d4b9eb87ed8ceaad25426e0e402 Mon Sep 17 00:00:00 2001 From: i701 Date: Thu, 3 Jul 2025 21:03:15 +0500 Subject: [PATCH] =?UTF-8?q?feat(billing):=20Enhance=20Topup=20admin=20inte?= =?UTF-8?q?rface=20and=20add=20default=20ordering=20for=20Topup=20model=20?= =?UTF-8?q?=E2=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- billing/admin.py | 20 +++++++++++++++++++- billing/models.py | 3 +++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/billing/admin.py b/billing/admin.py index db6311c..becf3cb 100644 --- a/billing/admin.py +++ b/billing/admin.py @@ -18,6 +18,24 @@ class PaymentAdmin(admin.ModelAdmin): ) +class TopupAdmin(admin.ModelAdmin): + list_display = ( + "id", + "user", + "amount", + "paid", + "paid_at", + "created_at", + "updated_at", + ) + search_fields = ( + "user__first_name", + "user__last_name", + "user__id_card", + "user__mobile", + ) + + admin.site.register(Payment, PaymentAdmin) admin.site.register(BillFormula) -admin.site.register(Topup) +admin.site.register(Topup, TopupAdmin) diff --git a/billing/models.py b/billing/models.py index 08041e7..8017793 100644 --- a/billing/models.py +++ b/billing/models.py @@ -58,3 +58,6 @@ class Topup(models.Model): def __str__(self): return f"Topup for {self.user}" + + class Meta: + ordering = ["-created_at"]