Browse Source

Add inline osoba do orga v adminu

export_seznamu_prednasek
Jonas Havelka 3 years ago
parent
commit
d03911199f
  1. 8
      seminar/admin.py

8
seminar/admin.py

@ -131,12 +131,14 @@ class OsobaAdmin(admin.ModelAdmin):
org.save() org.save()
udelej_orgem.short_description = "Udělej vybraných osob organizátory" udelej_orgem.short_description = "Udělej vybraných osob organizátory"
class OsobaInline(admin.TabularInline):
model = m.Osoba
@admin.register(m.Organizator) @admin.register(m.Organizator)
class OrganizatorAdmin(admin.ModelAdmin): class OrganizatorAdmin(admin.ModelAdmin):
search_fields = ['osoba__jmeno', 'osoba__prijmeni', 'osoba__prezdivka'] search_fields = ['osoba__jmeno', 'osoba__prijmeni', 'osoba__prezdivka']
inline_type = 'stacked'
class OsobaInline(admin.TabularInline): inline_reverse = ['osoba']
model = m.Osoba
@admin.register(m.Resitel) @admin.register(m.Resitel)
class ResitelAdmin(ReverseModelAdmin): class ResitelAdmin(ReverseModelAdmin):

Loading…
Cancel
Save