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.Soustredeni)
# TODO: Polymorphic admin
admin.site.register(m.Problem)
admin.site.register(m.Tema)
admin.site.register(m.Clanek)
admin.site.register(m.Text)
admin.site.register(m.Uloha)
# END TODO.
@admin.register(m.Problem)
class ProblemAdmin(PolymorphicParentModelAdmin):
base_model = m.Problem
child_models = [
m.Tema,
m.Clanek,
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.Hodnoceni)
admin.site.register(m.PrilohaReseni)

Loading…
Cancel
Save