|
@ -200,6 +200,12 @@ class CisloView(generic.DetailView): |
|
|
vysledky = VysledkyKCisluZaRocnik.objects.filter(cislo = context['cislo']).order_by('-body', 'resitel__prijmeni', 'resitel__jmeno') |
|
|
vysledky = VysledkyKCisluZaRocnik.objects.filter(cislo = context['cislo']).order_by('-body', 'resitel__prijmeni', 'resitel__jmeno') |
|
|
reseni = Reseni.objects.filter(cislo_body = context['cislo']).select_related("resitel") |
|
|
reseni = Reseni.objects.filter(cislo_body = context['cislo']).select_related("resitel") |
|
|
|
|
|
|
|
|
|
|
|
# typy úloh, které se mají zobrazovat u čísla, tj. těch, které byly v čísle skutečně zadány |
|
|
|
|
|
typy_skutecne_zadanych = [Problem.TYP_ULOHA, Problem.TYP_SERIAL, Problem.TYP_ORG_CLANEK] |
|
|
|
|
|
v_cisle_zadane = Problem.objects.filter(cislo_zadani=context['cislo']).filter(typ__in=typy_skutecne_zadanych).order_by('cislo_reseni__cislo', 'kod') |
|
|
|
|
|
|
|
|
|
|
|
resene_problemy = Problem.objects.filter(cislo_reseni=context['cislo']).filter(typ__in=typy_skutecne_zadanych).order_by('cislo_reseni__cislo', 'kod') |
|
|
|
|
|
|
|
|
problemy = sorted(list(set([r.problem for r in reseni])), key=lambda x:(0 if x.typ==Problem.TYP_ULOHA else 1,x.kod)) |
|
|
problemy = sorted(list(set([r.problem for r in reseni])), key=lambda x:(0 if x.typ==Problem.TYP_ULOHA else 1,x.kod)) |
|
|
#setridi problemy podle typu a poradi zadani |
|
|
#setridi problemy podle typu a poradi zadani |
|
|
problem_index = {} |
|
|
problem_index = {} |
|
@ -264,6 +270,8 @@ class CisloView(generic.DetailView): |
|
|
|
|
|
|
|
|
context['vysledkovka'] = vysledkovka |
|
|
context['vysledkovka'] = vysledkovka |
|
|
context['problemy'] = problemy |
|
|
context['problemy'] = problemy |
|
|
|
|
|
context['v_cisle_zadane'] = v_cisle_zadane |
|
|
|
|
|
context['resene_problemy'] = resene_problemy |
|
|
return context |
|
|
return context |
|
|
|
|
|
|
|
|
### Generovani vysledkovky |
|
|
### Generovani vysledkovky |
|
|