|
|
@ -1,6 +1,8 @@ |
|
|
|
from django.contrib import admin |
|
|
|
|
|
|
|
from polymorphic.admin import PolymorphicParentModelAdmin, PolymorphicChildModelAdmin, PolymorphicChildModelFilter |
|
|
|
from reversion.admin import VersionAdmin |
|
|
|
from django_reverse_admin import ReverseModelAdmin |
|
|
|
|
|
|
|
# Todo: reversion |
|
|
|
|
|
|
@ -9,7 +11,6 @@ import seminar.models as m |
|
|
|
admin.site.register(m.Osoba) |
|
|
|
admin.site.register(m.Skola) |
|
|
|
admin.site.register(m.Prijemce) |
|
|
|
admin.site.register(m.Resitel) |
|
|
|
admin.site.register(m.Rocnik) |
|
|
|
admin.site.register(m.Cislo) |
|
|
|
admin.site.register(m.Organizator) |
|
|
@ -39,11 +40,35 @@ class UlohaAdmin(PolymorphicChildModelAdmin): |
|
|
|
base_model = m.Uloha |
|
|
|
show_in_index = True |
|
|
|
|
|
|
|
|
|
|
|
class TextAdminInline(admin.TabularInline): |
|
|
|
model = m.Text |
|
|
|
exclude = ['text_zkraceny_set','text_zkraceny'] |
|
|
|
admin.site.register(m.Text) |
|
|
|
admin.site.register(m.Reseni) |
|
|
|
admin.site.register(m.Hodnoceni) |
|
|
|
|
|
|
|
class ResitelInline(admin.TabularInline): |
|
|
|
model = m.Resitel |
|
|
|
extra = 1 |
|
|
|
admin.site.register(m.Resitel) |
|
|
|
|
|
|
|
class PrilohaReseniInline(admin.TabularInline): |
|
|
|
model = m.PrilohaReseni |
|
|
|
extra = 1 |
|
|
|
admin.site.register(m.PrilohaReseni) |
|
|
|
|
|
|
|
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'] |
|
|
|
exclude = ['text_zkraceny', 'text_zkraceny_set'] |
|
|
|
inlines = [PrilohaReseniInline] |
|
|
|
# FAIL in template |
|
|
|
# inlines = [PrilohaReseniInline,Reseni_ResiteleInline] |
|
|
|
|
|
|
|
admin.site.register(m.Hodnoceni) |
|
|
|
admin.site.register(m.Pohadka) |
|
|
|
admin.site.register(m.Konfera) |
|
|
|
admin.site.register(m.Obrazek) |
|
|
|