Browse Source

Autocomplete pro nadproblem

export_seznamu_prednasek
parent
commit
0b46abb484
  1. 6
      seminar/admin.py

6
seminar/admin.py

@ -61,26 +61,32 @@ class ProblemAdmin(PolymorphicParentModelAdmin):
m.Uloha,
m.Konfera,
]
# Pokud chceme orezavat na aktualni rocnik, musime do modelu pridat odkaz na rocnik. Zatim bere vse.
search_fields = ['nazev']
@admin.register(m.Tema)
class TemaAdmin(PolymorphicChildModelAdmin):
base_model = m.Tema
show_in_index = True
autocomplete_fields = ['nadproblem']
@admin.register(m.Clanek)
class ClanekAdmin(PolymorphicChildModelAdmin):
base_model = m.Clanek
show_in_index = True
autocomplete_fields = ['nadproblem']
@admin.register(m.Uloha)
class UlohaAdmin(PolymorphicChildModelAdmin):
base_model = m.Uloha
show_in_index = True
autocomplete_fields = ['nadproblem']
@admin.register(m.Konfera)
class KonferaAdmin(PolymorphicChildModelAdmin):
base_model = m.Konfera
show_in_index = True
autocomplete_fields = ['nadproblem']
class TextAdminInline(admin.TabularInline):

Loading…
Cancel
Save