Opraveno poradi vysledkovky
This commit is contained in:
parent
51f3b22f09
commit
8cc0cf62d0
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue