membershipworks: Use new Django 5.1 __ lookups in admin list_display

https://docs.djangoproject.com/en/5.1/releases/5.1/#django-contrib-admin
This commit is contained in:
Adam Goldsmith 2024-08-07 13:18:05 -04:00
parent a8b8e148fc
commit 8fccb3c7fb

View File

@ -125,9 +125,9 @@ class EventInvoiceAdmin(admin.ModelAdmin):
list_display = [ list_display = [
"uuid", "uuid",
"event", "event",
"_event_start", "event__start",
"_event_end", "event__end",
"_event_instructor", "event__instructor",
"date_submitted", "date_submitted",
"date_paid", "date_paid",
"amount", "amount",
@ -147,18 +147,6 @@ class EventInvoiceAdmin(admin.ModelAdmin):
] ]
date_hierarchy = "date_submitted" date_hierarchy = "date_submitted"
@admin.display(ordering="event__instructor")
def _event_instructor(self, obj):
return obj.event.instructor
@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