Add search fields and date drilldowns to various admin pages

This commit is contained in:
Adam Goldsmith 2023-12-29 18:19:58 -05:00
parent 0ab7da0463
commit ee7c18f575
3 changed files with 4 additions and 0 deletions

View File

@ -14,6 +14,7 @@ class DoorAdmin(admin.ModelAdmin):
@admin.register(HIDEvent) @admin.register(HIDEvent)
class HIDEventAdmin(DjangoObjectActions, admin.ModelAdmin): class HIDEventAdmin(DjangoObjectActions, admin.ModelAdmin):
search_fields = ["forename", "surname", "cardholder_id"] search_fields = ["forename", "surname", "cardholder_id"]
date_hierarchy = "timestamp"
list_display = ["timestamp", "door", "event_type", "description", "_is_red"] list_display = ["timestamp", "door", "event_type", "description", "_is_red"]
list_filter = [ list_filter = [
"timestamp", "timestamp",

View File

@ -71,3 +71,5 @@ class TransactionAdmin(BaseMembershipWorksAdmin):
list_display = ["timestamp", "member", "name", "type", "sum", "note"] list_display = ["timestamp", "member", "name", "type", "sum", "note"]
list_filter = ["type"] list_filter = ["type"]
show_facets = admin.ShowFacets.ALWAYS show_facets = admin.ShowFacets.ALWAYS
search_fields = ["member", "name", "type", "note"]
date_hierarchy = "timestamp"

View File

@ -107,6 +107,7 @@ class CertificationAdmin(admin.ModelAdmin):
"certification_version__definition__name", "certification_version__definition__name",
"certification_version__definition__department__name", "certification_version__definition__department__name",
] ]
date_hierarchy = "date"
autocomplete_fields = ["member"] autocomplete_fields = ["member"]
exclude = ["shop_lead_notified"] exclude = ["shop_lead_notified"]
inlines = [CertificationAuditInline] inlines = [CertificationAuditInline]