|
|
@ -29,10 +29,10 @@ class CisloView(generic.DetailView): |
|
|
|
def get_context_data(self, **kwargs): |
|
|
|
context = super(CisloView, self).get_context_data(**kwargs) |
|
|
|
|
|
|
|
vysledky = VysledkyKCislu.objects.filter(cislo = context['cislo']).select_related("resitel") |
|
|
|
vysledky = VysledkyKCislu.objects.filter(cislo = context['cislo']).order_by('-body_celkem').select_related("resitel") |
|
|
|
reseni = Reseni.objects.filter(cislo_body = context['cislo']).select_related("resitel") |
|
|
|
|
|
|
|
problemy = sorted(list(set([r.problem for r in reseni])), key=lambda x: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)) |
|
|
|
problem_index = {} |
|
|
|
for i in range(len(problemy)): |
|
|
|
problem_index[problemy[i].id] = i |
|
|
|