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
This commit is contained in:
Adam Goldsmith 2023-12-04 13:08:36 -05:00
parent cacde865c0
commit e03b9e3c70
3 changed files with 5 additions and 0 deletions

View File

@ -29,4 +29,5 @@ class FlagAdmin(ReadOnlyAdmin):
inlines = [MemberFlagInline]
list_display = ["name", "type"]
list_filter = ["type"]
show_facets = admin.ShowFacets.ALWAYS
search_fields = ["name"]

View File

@ -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")

View File

@ -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",