From 86915f6ec540c1a30f13517f461cd1fa2afe0336 Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Fri, 18 Sep 2020 20:21:30 +0200 Subject: [PATCH] Added list display of Places and PhotoAlbums admin pages. --- django_lostplaces/lostplaces/admin.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/django_lostplaces/lostplaces/admin.py b/django_lostplaces/lostplaces/admin.py index 338bf8a..ae08b2b 100644 --- a/django_lostplaces/lostplaces/admin.py +++ b/django_lostplaces/lostplaces/admin.py @@ -16,8 +16,14 @@ class VoucherAdmin(admin.ModelAdmin): fields = ['code', 'expires_when', 'created_when'] readonly_fields = ['created_when'] +class PhotoAlbumsAdmin(admin.ModelAdmin): + list_display = ('label', 'place', 'url' ) + +class PlacesAdmin(admin.ModelAdmin): + list_display = ('name', 'submitted_by', 'submitted_when') + admin.site.register(Explorer) admin.site.register(Voucher, VoucherAdmin) -admin.site.register(Place) +admin.site.register(Place, PlacesAdmin) admin.site.register(PlaceImage) -admin.site.register(PhotoAlbum) +admin.site.register(PhotoAlbum, PhotoAlbumsAdmin)