|
@ -113,7 +113,6 @@ class PrilohaReseniInline(admin.StackedInline): |
|
|
|
|
|
|
|
|
class ProblemInline(admin.TabularInline): |
|
|
class ProblemInline(admin.TabularInline): |
|
|
model = Problem |
|
|
model = Problem |
|
|
fk_name = 'cislo_zadani' |
|
|
|
|
|
fields = ['kod', 'nazev', 'autor', 'garant', 'opravovatele', 'stav'] |
|
|
fields = ['kod', 'nazev', 'autor', 'garant', 'opravovatele', 'stav'] |
|
|
formfield_overrides = { |
|
|
formfield_overrides = { |
|
|
models.TextField: {'widget': forms.TextInput}, |
|
|
models.TextField: {'widget': forms.TextInput}, |
|
@ -280,7 +279,7 @@ class CisloAdmin(VersionAdmin): |
|
|
make_set_action('verejna_vysledkovka', True, 'Zveřejnit výsledkovku'), |
|
|
make_set_action('verejna_vysledkovka', True, 'Zveřejnit výsledkovku'), |
|
|
make_set_action('verejna_vysledkovka', False, 'Skrýt (zneveřejnit) výsledkovku'), |
|
|
make_set_action('verejna_vysledkovka', False, 'Skrýt (zneveřejnit) výsledkovku'), |
|
|
] |
|
|
] |
|
|
inlines = [ProblemInline] |
|
|
#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) |
|
@ -329,10 +328,10 @@ class ReseniAdmin(VersionAdmin): |
|
|
(u'Poznámky', {'fields': ['poznamka']}), |
|
|
(u'Poznámky', {'fields': ['poznamka']}), |
|
|
] |
|
|
] |
|
|
readonly_fields = ['cas_doruceni'] |
|
|
readonly_fields = ['cas_doruceni'] |
|
|
list_display = [ProblemInline, ResitelInline, 'forma', 'cas_doruceni'] |
|
|
list_display = [ResitelInline, 'forma', 'cas_doruceni'] |
|
|
list_filter = ['cas_doruceni', 'forma'] |
|
|
list_filter = ['cas_doruceni', 'forma'] |
|
|
search_fields = [] |
|
|
search_fields = [] |
|
|
inlines = [PrilohaReseniInline,ProblemInline,ResitelInline] |
|
|
inlines = [PrilohaReseniInline,ResitelInline] |
|
|
view_on_site = False |
|
|
view_on_site = False |
|
|
|
|
|
|
|
|
def get_queryset(self, request): |
|
|
def get_queryset(self, request): |
|
@ -459,7 +458,7 @@ class ProblemAdmin(VersionAdmin): |
|
|
|
|
|
|
|
|
def get_queryset(self, request): |
|
|
def get_queryset(self, request): |
|
|
qs = super(ProblemAdmin, self).get_queryset(request) |
|
|
qs = super(ProblemAdmin, self).get_queryset(request) |
|
|
return qs.select_related('autor', 'opravovatel', 'cislo_zadani', 'cislo_reseni') |
|
|
return qs.select_related('autor', 'opravovatel', 'cislo_reseni') |
|
|
|
|
|
|
|
|
def pocet_reseni(self, obj): |
|
|
def pocet_reseni(self, obj): |
|
|
return obj.pocet_reseni |
|
|
return obj.pocet_reseni |
|
|