From c58217ccaa5e1495779576b1673c6c973e82036c Mon Sep 17 00:00:00 2001 From: Jonas Havelka Date: Thu, 16 Sep 2021 12:35:29 +0200 Subject: [PATCH] =?UTF-8?q?Inline=20Osoby=20do=20=C5=98e=C5=A1itele=20(v?= =?UTF-8?q?=20adminu)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/admin.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/seminar/admin.py b/seminar/admin.py index 81314119..cdfcb413 100644 --- a/seminar/admin.py +++ b/seminar/admin.py @@ -136,11 +136,16 @@ class OsobaAdmin(admin.ModelAdmin): @admin.register(m.Organizator) class OrganizatorAdmin(admin.ModelAdmin): search_fields = ['osoba__jmeno', 'osoba__prijmeni', 'osoba__prezdivka'] - + +class OsobaInline(admin.TabularInline): + model = m.Osoba + @admin.register(m.Resitel) -class ResitelAdmin(admin.ModelAdmin): +class ResitelAdmin(ReverseModelAdmin): search_fields = ['osoba__jmeno', 'osoba__prijmeni', 'osoba__prezdivka'] ordering = ('osoba__jmeno','osoba__prijmeni') + inline_type = 'stacked' + inline_reverse = ['osoba'] @admin.register(m.Problem) class ProblemAdmin(PolymorphicParentModelAdmin):