membershipworks: Add event start/end to EventInvoice list_display
All checks were successful
Ruff / ruff (push) Successful in 29s
Test / test (push) Successful in 3m55s

This commit is contained in:
Adam Goldsmith 2024-05-24 11:30:34 -04:00
parent 26420ce28e
commit 229558116b

View File

@ -121,6 +121,8 @@ class EventInvoiceAdmin(admin.ModelAdmin):
list_display = [ list_display = [
"uuid", "uuid",
"event", "event",
"_event_start",
"_event_end",
"date_submitted", "date_submitted",
"date_paid", "date_paid",
"amount", "amount",
@ -139,6 +141,14 @@ class EventInvoiceAdmin(admin.ModelAdmin):
] ]
date_hierarchy = "date_submitted" date_hierarchy = "date_submitted"
@admin.display(ordering="event__start")
def _event_start(self, obj):
return obj.event.start
@admin.display(ordering="event__end")
def _event_end(self, obj):
return obj.event.end
class EventInvoiceInline(admin.StackedInline): class EventInvoiceInline(admin.StackedInline):
model = EventInvoice model = EventInvoice