From a2a635faeb01dbe213246e94c142ea1b69eb4964 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Mon, 14 Feb 2022 20:49:04 -0500 Subject: sght: cleaned up admin --- app/sightings/admin.py | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'app/sightings') diff --git a/app/sightings/admin.py b/app/sightings/admin.py index 7285a7d..fc948c9 100644 --- a/app/sightings/admin.py +++ b/app/sightings/admin.py @@ -50,7 +50,6 @@ class SightingInline(OSMGeoAdmin, admin.StackedInline): @admin.register(AP) class APAdmin(admin.ModelAdmin): - form = LGEntryForm form = LGEntryForm inlines = [ SightingInline, @@ -59,13 +58,44 @@ class APAdmin(admin.ModelAdmin): list_filter = ('apclass__kind', 'apclass') search_fields = ['common_name', 'scientific_name'] + fieldsets = ( + ('Entry', { + 'fields': ( + ('common_name'), + 'body_markdown', + 'featured_image', + ), + 'classes': ( + 'show', + 'extrapretty', + 'wide' + ) + } + ), + ('Extras', { + 'fields': ( + 'slug', + 'apclass', + 'scientific_name', + 'code', + ), + 'classes': ( + 'collapse', + ) + }), + ) + def have_seen(self, obj): return obj.seen have_seen.admin_order_field = 'seen' have_seen.boolean = True + class Media: js = ('image-loader.js', 'next-prev-links.js') + css = { + "all": ("my_styles.css",) + } @admin.register(Sighting) -- cgit v1.2.3-70-g09d2