From d03911199f35f468ab49b3638697f2e017dc777e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Mon, 15 Nov 2021 20:33:28 +0100 Subject: [PATCH] Add inline osoba do orga v adminu --- seminar/admin.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/seminar/admin.py b/seminar/admin.py index 3ee14541..514dfa47 100644 --- a/seminar/admin.py +++ b/seminar/admin.py @@ -131,12 +131,14 @@ class OsobaAdmin(admin.ModelAdmin): org.save() udelej_orgem.short_description = "Udělej vybraných osob organizátory" +class OsobaInline(admin.TabularInline): + model = m.Osoba + @admin.register(m.Organizator) class OrganizatorAdmin(admin.ModelAdmin): search_fields = ['osoba__jmeno', 'osoba__prijmeni', 'osoba__prezdivka'] - -class OsobaInline(admin.TabularInline): - model = m.Osoba + inline_type = 'stacked' + inline_reverse = ['osoba'] @admin.register(m.Resitel) class ResitelAdmin(ReverseModelAdmin):