From 4ceb57e7882a77002549469a4e039f6d3dc09b7e Mon Sep 17 00:00:00 2001 From: Michael Hall Date: Sun, 18 Mar 2018 12:37:23 -0400 Subject: [PATCH] Add details to EventPhoto admin screen --- events/admin.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/events/admin.py b/events/admin.py index 5956063..3a2d94f 100644 --- a/events/admin.py +++ b/events/admin.py @@ -59,7 +59,12 @@ class EventAdmin(admin.ModelAdmin): attendee_count.short_description = 'Attendees' admin.site.register(Event, EventAdmin) -admin.site.register(EventPhoto) +class EventPhotoAdmin(admin.ModelAdmin): + list_display = ('title', 'event', 'view') + def view(self, photo): + return mark_safe('' % (photo.src.url, photo.thumbnail.url)) + view.short_description = 'Photo' +admin.site.register(EventPhoto, EventPhotoAdmin) class MemberAdmin(admin.ModelAdmin): list_display = ('__str__', 'role')