Browse Source

Admin: zadané problémy k číslu inline

remotes/origin/korekturovatko_emaily
Matěj Kocián 8 years ago
parent
commit
d67f58b9ef
  1. 13
      seminar/admin.py

13
seminar/admin.py

@ -107,6 +107,18 @@ class PrilohaReseniInline(admin.StackedInline):
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):
form = autocomplete_light.modelform_factory(Reseni, autocomplete_fields=['resitel'], fields=['resitel'])
model = Reseni
@ -244,6 +256,7 @@ class CisloAdmin(VersionAdmin):
make_set_action('verejna_vysledkovka', True, u'Zveřejnit výsledkovku'),
make_set_action('verejna_vysledkovka', False, u'Skrýt (zneveřejnit) výsledkovku'),
]
inlines = [ProblemInline]
def get_queryset(self, request):
qs = super(CisloAdmin, self).get_queryset(request)

Loading…
Cancel
Save