From ee7c18f5759b94827ca81a66f4465cee4f559f88 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Fri, 29 Dec 2023 18:19:58 -0500 Subject: [PATCH] Add search fields and date drilldowns to various admin pages --- doorcontrol/admin.py | 1 + membershipworks/admin.py | 2 ++ paperwork/admin.py | 1 + 3 files changed, 4 insertions(+) diff --git a/doorcontrol/admin.py b/doorcontrol/admin.py index 2f0b038..c0579e5 100644 --- a/doorcontrol/admin.py +++ b/doorcontrol/admin.py @@ -14,6 +14,7 @@ class DoorAdmin(admin.ModelAdmin): @admin.register(HIDEvent) class HIDEventAdmin(DjangoObjectActions, admin.ModelAdmin): search_fields = ["forename", "surname", "cardholder_id"] + date_hierarchy = "timestamp" list_display = ["timestamp", "door", "event_type", "description", "_is_red"] list_filter = [ "timestamp", diff --git a/membershipworks/admin.py b/membershipworks/admin.py index 5a9d3c0..ffc467a 100644 --- a/membershipworks/admin.py +++ b/membershipworks/admin.py @@ -71,3 +71,5 @@ class TransactionAdmin(BaseMembershipWorksAdmin): list_display = ["timestamp", "member", "name", "type", "sum", "note"] list_filter = ["type"] show_facets = admin.ShowFacets.ALWAYS + search_fields = ["member", "name", "type", "note"] + date_hierarchy = "timestamp" diff --git a/paperwork/admin.py b/paperwork/admin.py index f91844c..1d8862b 100644 --- a/paperwork/admin.py +++ b/paperwork/admin.py @@ -107,6 +107,7 @@ class CertificationAdmin(admin.ModelAdmin): "certification_version__definition__name", "certification_version__definition__department__name", ] + date_hierarchy = "date" autocomplete_fields = ["member"] exclude = ["shop_lead_notified"] inlines = [CertificationAuditInline]