From 8fccb3c7fb465dfc4cbd731dcaf4f3c5ecca96be Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Wed, 7 Aug 2024 13:18:05 -0400 Subject: [PATCH] membershipworks: Use new Django 5.1 `__` lookups in admin `list_display` https://docs.djangoproject.com/en/5.1/releases/5.1/#django-contrib-admin --- membershipworks/admin.py | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/membershipworks/admin.py b/membershipworks/admin.py index 70c3a2b..e1db0f3 100644 --- a/membershipworks/admin.py +++ b/membershipworks/admin.py @@ -125,9 +125,9 @@ class EventInvoiceAdmin(admin.ModelAdmin): list_display = [ "uuid", "event", - "_event_start", - "_event_end", - "_event_instructor", + "event__start", + "event__end", + "event__instructor", "date_submitted", "date_paid", "amount", @@ -147,18 +147,6 @@ class EventInvoiceAdmin(admin.ModelAdmin): ] 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): model = EventInvoice