Obejiti chyb v adminu.
This commit is contained in:
parent
2b6d0cbd10
commit
a17477762a
1 changed files with 4 additions and 5 deletions
|
@ -113,7 +113,6 @@ class PrilohaReseniInline(admin.StackedInline):
|
|||
|
||||
class ProblemInline(admin.TabularInline):
|
||||
model = Problem
|
||||
fk_name = 'cislo_zadani'
|
||||
fields = ['kod', 'nazev', 'autor', 'garant', 'opravovatele', 'stav']
|
||||
formfield_overrides = {
|
||||
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', False, 'Skrýt (zneveřejnit) výsledkovku'),
|
||||
]
|
||||
inlines = [ProblemInline]
|
||||
#inlines = [ProblemInline]
|
||||
|
||||
def get_queryset(self, request):
|
||||
qs = super(CisloAdmin, self).get_queryset(request)
|
||||
|
@ -329,10 +328,10 @@ class ReseniAdmin(VersionAdmin):
|
|||
(u'Poznámky', {'fields': ['poznamka']}),
|
||||
]
|
||||
readonly_fields = ['cas_doruceni']
|
||||
list_display = [ProblemInline, ResitelInline, 'forma', 'cas_doruceni']
|
||||
list_display = [ResitelInline, 'forma', 'cas_doruceni']
|
||||
list_filter = ['cas_doruceni', 'forma']
|
||||
search_fields = []
|
||||
inlines = [PrilohaReseniInline,ProblemInline,ResitelInline]
|
||||
inlines = [PrilohaReseniInline,ResitelInline]
|
||||
view_on_site = False
|
||||
|
||||
def get_queryset(self, request):
|
||||
|
@ -459,7 +458,7 @@ class ProblemAdmin(VersionAdmin):
|
|||
|
||||
def get_queryset(self, 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):
|
||||
return obj.pocet_reseni
|
||||
|
|
Loading…
Reference in a new issue