Browse Source

Admin pro polymorfické problémy

export_seznamu_prednasek
Pavel "LEdoian" Turinsky 5 years ago
parent
commit
81c561a1a8
  1. 32
      seminar/admin.py

32
seminar/admin.py

@ -15,14 +15,32 @@ admin.site.register(m.Cislo)
admin.site.register(m.Organizator) admin.site.register(m.Organizator)
admin.site.register(m.Soustredeni) admin.site.register(m.Soustredeni)
# TODO: Polymorphic admin @admin.register(m.Problem)
admin.site.register(m.Problem) class ProblemAdmin(PolymorphicParentModelAdmin):
admin.site.register(m.Tema) base_model = m.Problem
admin.site.register(m.Clanek) child_models = [
admin.site.register(m.Text) m.Tema,
admin.site.register(m.Uloha) m.Clanek,
# END TODO. m.Uloha,
]
@admin.register(m.Tema)
class TemaAdmin(PolymorphicChildModelAdmin):
base_model = m.Tema
show_in_index = True
@admin.register(m.Clanek)
class ClanekAdmin(PolymorphicChildModelAdmin):
base_model = m.Clanek
show_in_index = True
@admin.register(m.Uloha)
class UlohaAdmin(PolymorphicChildModelAdmin):
base_model = m.Uloha
show_in_index = True
admin.site.register(m.Text)
admin.site.register(m.Reseni) admin.site.register(m.Reseni)
admin.site.register(m.Hodnoceni) admin.site.register(m.Hodnoceni)
admin.site.register(m.PrilohaReseni) admin.site.register(m.PrilohaReseni)

Loading…
Cancel
Save