From d2719e0e0b4858a6174ad2254cb98e1e53e3013d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Koci=C3=A1n?= Date: Sun, 13 Sep 2015 11:57:52 +0200 Subject: [PATCH] =?UTF-8?q?=C5=98azen=C3=AD=20=C3=BAloh=20a=20t=C3=A9mat?= =?UTF-8?q?=20podle=20=C4=8D=C3=ADsla=20a=20pak=20podle=20k=C3=B3du?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/seminar/views.py b/seminar/views.py index 4eaf8f19..e2549fd7 100644 --- a/seminar/views.py +++ b/seminar/views.py @@ -153,7 +153,7 @@ class RocnikView(generic.DetailView): vysledkovka.append(v) - temata_v_rocniku = Problem.objects.filter(typ=Problem.TYP_TEMA, cislo_zadani__rocnik=context['rocnik']) + temata_v_rocniku = Problem.objects.filter(typ=Problem.TYP_TEMA, cislo_zadani__rocnik=context['rocnik']).order_by('kod') context['vysledkovka'] = vysledkovka context['temata_v_rocniku'] = temata_v_rocniku @@ -194,9 +194,9 @@ class CisloView(generic.DetailView): # 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') + v_cisle_zadane = Problem.objects.filter(cislo_zadani=context['cislo']).filter(typ__in=typy_skutecne_zadanych).order_by('kod') - resene_problemy = Problem.objects.filter(cislo_reseni=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_zadani__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_v_rocniku)) #setridi problemy podle typu a poradi zadani