|
|
@ -77,6 +77,7 @@ class ResitelInline(admin.TabularInline): |
|
|
|
fields = ['jmeno', 'prijmeni', 'skola', 'mesto', 'rok_maturity', ] |
|
|
|
readonly_fields = ['jmeno', 'prijmeni', 'skola', 'mesto', 'rok_maturity', ] |
|
|
|
extra = 0 |
|
|
|
view_on_site = False |
|
|
|
|
|
|
|
def has_add_permission(self, req): return False |
|
|
|
|
|
|
@ -89,6 +90,7 @@ class CisloInline(admin.TabularInline): |
|
|
|
formfield_overrides = { |
|
|
|
models.TextField: {'widget': forms.TextInput}, |
|
|
|
} |
|
|
|
view_on_site = Cislo.verejne_url |
|
|
|
|
|
|
|
def has_add_permission(self, req): return False |
|
|
|
|
|
|
@ -100,9 +102,11 @@ class PrilohaReseniInline(admin.StackedInline): |
|
|
|
formfield_overrides = { |
|
|
|
models.TextField: {'widget': forms.TextInput}, |
|
|
|
} |
|
|
|
view_on_site = False |
|
|
|
|
|
|
|
extra = 0 |
|
|
|
|
|
|
|
|
|
|
|
class ReseniKProblemuInline(admin.TabularInline): |
|
|
|
form = autocomplete_light.modelform_factory(Reseni, autocomplete_fields=['resitel'], fields=['resitel']) |
|
|
|
model = Reseni |
|
|
@ -112,6 +116,7 @@ class ReseniKProblemuInline(admin.TabularInline): |
|
|
|
formfield_overrides = { |
|
|
|
models.TextField: {'widget': forms.TextInput}, |
|
|
|
} |
|
|
|
view_on_site = False |
|
|
|
|
|
|
|
def get_queryset(self, request): |
|
|
|
qs = super(ReseniKProblemuInline, self).get_queryset(request) |
|
|
@ -134,6 +139,7 @@ class ReseniKResiteliInline(admin.TabularInline): |
|
|
|
formfield_overrides = { |
|
|
|
models.TextField: {'widget': forms.TextInput}, |
|
|
|
} |
|
|
|
view_on_site = False |
|
|
|
|
|
|
|
def has_add_permission(self, req): return False |
|
|
|
|
|
|
@ -191,6 +197,7 @@ class ResitelAdmin(VersionAdmin): |
|
|
|
list_filter = ['pohlavi_muz', 'rok_maturity', 'zasilat'] |
|
|
|
search_fields = ['jmeno', 'prijmeni', 'ulice', 'mesto', 'email'] |
|
|
|
inlines = [ReseniKResiteliInline] |
|
|
|
view_on_site = False |
|
|
|
|
|
|
|
def get_queryset(self, request): |
|
|
|
qs = super(ResitelAdmin, self).get_queryset(request) |
|
|
@ -216,6 +223,7 @@ class SkolaAdmin(VersionAdmin): |
|
|
|
list_filter = ['stat', 'je_zs', 'je_ss'] |
|
|
|
search_fields = ['nazev', 'mesto', 'ulice'] |
|
|
|
inlines = [ResitelInline] |
|
|
|
view_on_site = False |
|
|
|
|
|
|
|
admin.site.register(Skola, SkolaAdmin) |
|
|
|
|
|
|
@ -288,6 +296,7 @@ class ReseniAdmin(VersionAdmin): |
|
|
|
list_filter = ['body', 'timestamp', 'forma'] |
|
|
|
search_fields = [] |
|
|
|
inlines = [PrilohaReseniInline] |
|
|
|
view_on_site = False |
|
|
|
|
|
|
|
def get_queryset(self, request): |
|
|
|
qs = super(ReseniAdmin, self).get_queryset(request) |
|
|
@ -307,6 +316,7 @@ class PohadkaAdminForm(forms.ModelForm): |
|
|
|
|
|
|
|
class PohadkaAdmin(VersionAdmin): |
|
|
|
form = PohadkaAdminForm |
|
|
|
view_on_site = False |
|
|
|
|
|
|
|
def get_kod_ulohy(self, obj): |
|
|
|
return obj.uloha.kod_v_rocniku() |
|
|
|