from django.contrib import admin from django_reverse_admin import ReverseModelAdmin from .models import * class PrilohaReseniInline(admin.TabularInline): model = PrilohaReseni extra = 1 class Reseni_ResiteleInline(admin.TabularInline): model = Reseni_Resitele @admin.register(Reseni) class ReseniAdmin(ReverseModelAdmin): base_model = 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(PrilohaReseni) admin.site.register(Hodnoceni)