From e03b9e3c709ec8869c1ad5921f21d3ff67e4497c Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Mon, 4 Dec 2023 13:08:36 -0500 Subject: [PATCH] Always show admin facet counts in most models with filters New feature in Django 5.0 Didn't enable always on HIDEvent admin, as the table size is relatively large --- membershipworks/admin.py | 1 + paperwork/admin.py | 3 +++ rentals/admin.py | 1 + 3 files changed, 5 insertions(+) diff --git a/membershipworks/admin.py b/membershipworks/admin.py index 4f0f5dc..a983c27 100644 --- a/membershipworks/admin.py +++ b/membershipworks/admin.py @@ -29,4 +29,5 @@ class FlagAdmin(ReadOnlyAdmin): inlines = [MemberFlagInline] list_display = ["name", "type"] list_filter = ["type"] + show_facets = admin.ShowFacets.ALWAYS search_fields = ["name"] diff --git a/paperwork/admin.py b/paperwork/admin.py index 1049d26..f91844c 100644 --- a/paperwork/admin.py +++ b/paperwork/admin.py @@ -87,6 +87,7 @@ class CertificationDefinitionAdmin(admin.ModelAdmin): "latest_semantic_version", ] list_filter = ["department"] + show_facets = admin.ShowFacets.ALWAYS inlines = [CertificationVersionInline] @admin.display(description="Latest Version") @@ -171,6 +172,7 @@ class CertificationAdmin(admin.ModelAdmin): ("shop_lead_notified", admin.EmptyFieldListFilter), ("audits", admin.EmptyFieldListFilter), ] + show_facets = admin.ShowFacets.ALWAYS actions = ["send_notifications"] @@ -253,6 +255,7 @@ class WaiverAdmin(admin.ModelAdmin): "waiver_version", ("audits", admin.EmptyFieldListFilter), ] + show_facets = admin.ShowFacets.ALWAYS inlines = [WaiverAuditInline] @admin.display(description="Latest Audit") diff --git a/rentals/admin.py b/rentals/admin.py index c184d44..f92ab8f 100644 --- a/rentals/admin.py +++ b/rentals/admin.py @@ -31,6 +31,7 @@ class LockerUnitAdmin(admin.ModelAdmin): class LockerInfoAdmin(admin.ModelAdmin): search_fields = ["renter__username", "locker_unit__bank__name"] list_filter = ["locker_unit__bank", "locker_unit"] + show_facets = admin.ShowFacets.ALWAYS list_display = [ "locker_unit", "address",