You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
"""
|
|
|
|
Soubor sloužící k definici toho, co bude v adminu. Většinou pouhým zavoláním
|
|
|
|
funkce :func:`django.contrib.admin.site.register`, v případě, že chceme něco
|
|
|
|
upravit, tak jako třída rozšiřující :class:`django.contrib.admin.ModelAdmin`
|
|
|
|
s dekorátorem :func:`django.contrib.admin.register`.
|
|
|
|
"""
|
|
|
|
from django.contrib import admin
|
|
|
|
from django_reverse_admin import ReverseModelAdmin
|
|
|
|
import seminar.models as m
|
|
|
|
|
|
|
|
|
|
|
|
class PrilohaReseniInline(admin.TabularInline):
|
|
|
|
model = m.PrilohaReseni
|
|
|
|
extra = 1
|
|
|
|
|
|
|
|
|
|
|
|
class Reseni_ResiteleInline(admin.TabularInline):
|
|
|
|
model = m.Reseni_Resitele
|
|
|
|
|
|
|
|
|
|
|
|
@admin.register(m.Reseni)
|
|
|
|
class ReseniAdmin(ReverseModelAdmin):
|
|
|
|
base_model = m.Reseni
|
|
|
|
inline_type = 'tabular'
|
|
|
|
# inline_reverse = ['text_cely','resitele'] TODO vrátit zpět a zrychlit dotaz
|
|
|
|
inline_reverse = ['resitele']
|
|
|
|
exclude = ['text_zkraceny', 'text_zkraceny_set']
|
|
|
|
inlines = [PrilohaReseniInline]
|
|
|
|
# FAIL in template
|
|
|
|
# inlines = [PrilohaReseniInline,Reseni_ResiteleInline]
|
|
|
|
|
|
|
|
|
|
|
|
admin.site.register(m.PrilohaReseni)
|
|
|
|
admin.site.register(m.Hodnoceni)
|