From e066cf2c037b9c4592658dc5ba82d8a32e079a88 Mon Sep 17 00:00:00 2001 From: Midgard Date: Wed, 22 Jul 2020 05:02:01 +0200 Subject: [PATCH] Improve admin view --- events/admin.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/events/admin.py b/events/admin.py index a1d2300..3509e89 100644 --- a/events/admin.py +++ b/events/admin.py @@ -2,5 +2,11 @@ from django.contrib import admin from .models import Event, EventRegistration -admin.site.register(Event) -admin.site.register(EventRegistration) + +class RegistrationInline(admin.StackedInline): + model = EventRegistration + +class EventAdmin(admin.ModelAdmin): + inlines = [RegistrationInline] + +admin.site.register(Event, EventAdmin)