Browse Source

Opraveno poradi vysledkovky

remotes/origin/feincms
Tomas Gavenciak 10 years ago
parent
commit
8cc0cf62d0
  1. 4
      seminar/views.py

4
seminar/views.py

@ -29,10 +29,10 @@ class CisloView(generic.DetailView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super(CisloView, self).get_context_data(**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") 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 = {} problem_index = {}
for i in range(len(problemy)): for i in range(len(problemy)):
problem_index[problemy[i].id] = i problem_index[problemy[i].id] = i

Loading…
Cancel
Save