|
@ -77,6 +77,7 @@ class ResitelInline(admin.TabularInline): |
|
|
fields = ['jmeno', 'prijmeni', 'skola', 'mesto', 'rok_maturity', ] |
|
|
fields = ['jmeno', 'prijmeni', 'skola', 'mesto', 'rok_maturity', ] |
|
|
readonly_fields = ['jmeno', 'prijmeni', 'skola', 'mesto', 'rok_maturity', ] |
|
|
readonly_fields = ['jmeno', 'prijmeni', 'skola', 'mesto', 'rok_maturity', ] |
|
|
extra = 0 |
|
|
extra = 0 |
|
|
|
|
|
view_on_site = False |
|
|
|
|
|
|
|
|
def has_add_permission(self, req): return False |
|
|
def has_add_permission(self, req): return False |
|
|
|
|
|
|
|
@ -89,6 +90,7 @@ class CisloInline(admin.TabularInline): |
|
|
formfield_overrides = { |
|
|
formfield_overrides = { |
|
|
models.TextField: {'widget': forms.TextInput}, |
|
|
models.TextField: {'widget': forms.TextInput}, |
|
|
} |
|
|
} |
|
|
|
|
|
view_on_site = Cislo.verejne_url |
|
|
|
|
|
|
|
|
def has_add_permission(self, req): return False |
|
|
def has_add_permission(self, req): return False |
|
|
|
|
|
|
|
@ -100,9 +102,23 @@ class PrilohaReseniInline(admin.StackedInline): |
|
|
formfield_overrides = { |
|
|
formfield_overrides = { |
|
|
models.TextField: {'widget': forms.TextInput}, |
|
|
models.TextField: {'widget': forms.TextInput}, |
|
|
} |
|
|
} |
|
|
|
|
|
view_on_site = False |
|
|
|
|
|
|
|
|
extra = 0 |
|
|
extra = 0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ProblemInline(admin.TabularInline): |
|
|
|
|
|
model = Problem |
|
|
|
|
|
fk_name = 'cislo_zadani' |
|
|
|
|
|
fields = ['kod', 'typ', 'nazev', 'body', 'opravovatel', 'stav'] |
|
|
|
|
|
formfield_overrides = { |
|
|
|
|
|
models.TextField: {'widget': forms.TextInput}, |
|
|
|
|
|
} |
|
|
|
|
|
view_on_site = Problem.verejne_url |
|
|
|
|
|
|
|
|
|
|
|
extra = 0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ReseniKProblemuInline(admin.TabularInline): |
|
|
class ReseniKProblemuInline(admin.TabularInline): |
|
|
form = autocomplete_light.modelform_factory(Reseni, autocomplete_fields=['resitel'], fields=['resitel']) |
|
|
form = autocomplete_light.modelform_factory(Reseni, autocomplete_fields=['resitel'], fields=['resitel']) |
|
|
model = Reseni |
|
|
model = Reseni |
|
@ -112,6 +128,7 @@ class ReseniKProblemuInline(admin.TabularInline): |
|
|
formfield_overrides = { |
|
|
formfield_overrides = { |
|
|
models.TextField: {'widget': forms.TextInput}, |
|
|
models.TextField: {'widget': forms.TextInput}, |
|
|
} |
|
|
} |
|
|
|
|
|
view_on_site = False |
|
|
|
|
|
|
|
|
def get_queryset(self, request): |
|
|
def get_queryset(self, request): |
|
|
qs = super(ReseniKProblemuInline, self).get_queryset(request) |
|
|
qs = super(ReseniKProblemuInline, self).get_queryset(request) |
|
@ -134,6 +151,7 @@ class ReseniKResiteliInline(admin.TabularInline): |
|
|
formfield_overrides = { |
|
|
formfield_overrides = { |
|
|
models.TextField: {'widget': forms.TextInput}, |
|
|
models.TextField: {'widget': forms.TextInput}, |
|
|
} |
|
|
} |
|
|
|
|
|
view_on_site = False |
|
|
|
|
|
|
|
|
def has_add_permission(self, req): return False |
|
|
def has_add_permission(self, req): return False |
|
|
|
|
|
|
|
@ -191,6 +209,7 @@ class ResitelAdmin(VersionAdmin): |
|
|
list_filter = ['pohlavi_muz', 'rok_maturity', 'zasilat'] |
|
|
list_filter = ['pohlavi_muz', 'rok_maturity', 'zasilat'] |
|
|
search_fields = ['jmeno', 'prijmeni', 'ulice', 'mesto', 'email'] |
|
|
search_fields = ['jmeno', 'prijmeni', 'ulice', 'mesto', 'email'] |
|
|
inlines = [ReseniKResiteliInline] |
|
|
inlines = [ReseniKResiteliInline] |
|
|
|
|
|
view_on_site = False |
|
|
|
|
|
|
|
|
def get_queryset(self, request): |
|
|
def get_queryset(self, request): |
|
|
qs = super(ResitelAdmin, self).get_queryset(request) |
|
|
qs = super(ResitelAdmin, self).get_queryset(request) |
|
@ -216,6 +235,7 @@ class SkolaAdmin(VersionAdmin): |
|
|
list_filter = ['stat', 'je_zs', 'je_ss'] |
|
|
list_filter = ['stat', 'je_zs', 'je_ss'] |
|
|
search_fields = ['nazev', 'mesto', 'ulice'] |
|
|
search_fields = ['nazev', 'mesto', 'ulice'] |
|
|
inlines = [ResitelInline] |
|
|
inlines = [ResitelInline] |
|
|
|
|
|
view_on_site = False |
|
|
|
|
|
|
|
|
admin.site.register(Skola, SkolaAdmin) |
|
|
admin.site.register(Skola, SkolaAdmin) |
|
|
|
|
|
|
|
@ -236,6 +256,7 @@ class CisloAdmin(VersionAdmin): |
|
|
make_set_action('verejna_vysledkovka', True, u'Zveřejnit výsledkovku'), |
|
|
make_set_action('verejna_vysledkovka', True, u'Zveřejnit výsledkovku'), |
|
|
make_set_action('verejna_vysledkovka', False, u'Skrýt (zneveřejnit) výsledkovku'), |
|
|
make_set_action('verejna_vysledkovka', False, u'Skrýt (zneveřejnit) výsledkovku'), |
|
|
] |
|
|
] |
|
|
|
|
|
inlines = [ProblemInline] |
|
|
|
|
|
|
|
|
def get_queryset(self, request): |
|
|
def get_queryset(self, request): |
|
|
qs = super(CisloAdmin, self).get_queryset(request) |
|
|
qs = super(CisloAdmin, self).get_queryset(request) |
|
@ -288,6 +309,7 @@ class ReseniAdmin(VersionAdmin): |
|
|
list_filter = ['body', 'timestamp', 'forma'] |
|
|
list_filter = ['body', 'timestamp', 'forma'] |
|
|
search_fields = [] |
|
|
search_fields = [] |
|
|
inlines = [PrilohaReseniInline] |
|
|
inlines = [PrilohaReseniInline] |
|
|
|
|
|
view_on_site = False |
|
|
|
|
|
|
|
|
def get_queryset(self, request): |
|
|
def get_queryset(self, request): |
|
|
qs = super(ReseniAdmin, self).get_queryset(request) |
|
|
qs = super(ReseniAdmin, self).get_queryset(request) |
|
@ -307,6 +329,7 @@ class PohadkaAdminForm(forms.ModelForm): |
|
|
|
|
|
|
|
|
class PohadkaAdmin(VersionAdmin): |
|
|
class PohadkaAdmin(VersionAdmin): |
|
|
form = PohadkaAdminForm |
|
|
form = PohadkaAdminForm |
|
|
|
|
|
view_on_site = False |
|
|
|
|
|
|
|
|
def get_kod_ulohy(self, obj): |
|
|
def get_kod_ulohy(self, obj): |
|
|
return obj.uloha.kod_v_rocniku() |
|
|
return obj.uloha.kod_v_rocniku() |
|
|