Autocomplete pro nadproblem
This commit is contained in:
parent
600d0efd48
commit
0b46abb484
1 changed files with 6 additions and 0 deletions
|
@ -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…
Reference in a new issue