2021-10-08 10:36:59 +02:00
|
|
|
from django.contrib import admin
|
|
|
|
from django_reverse_admin import ReverseModelAdmin
|
2024-10-30 15:03:17 +01:00
|
|
|
import odevzdavatko.models as m
|
2021-10-08 10:36:59 +02:00
|
|
|
|
|
|
|
|
|
|
|
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)
|