From c83e355efd4d5777a7262dcdea1e0daeb912276c Mon Sep 17 00:00:00 2001 From: "Bc. Petr Pecha" Date: Sun, 15 Nov 2015 22:12:09 +0100 Subject: [PATCH] tituly | oprava ziskavani titulu --- seminar/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/seminar/views.py b/seminar/views.py index 1f51048a..aadca056 100644 --- a/seminar/views.py +++ b/seminar/views.py @@ -384,13 +384,16 @@ def obalkyView(request,resitele): ### Tituly +# TODO udelat neco jako get_objects_or_404 def TitulyView(request, rocnik, cislo): rocnik_obj = Rocnik.objects.filter(rocnik = rocnik).first() resitele = Resitel.objects.filter(rok_maturity__gte = rocnik_obj.prvni_rok) cislo_obj = Cislo.objects.filter(rocnik = rocnik_obj, cislo = cislo).first() for resitel in resitele: - vys = VysledkyKCisluOdjakziva.objects.filter(resitel = resitele, cislo = cislo_obj).first() + rocnik_obj = Rocnik.objects.filter(rocnik = rocnik) + cislo_obj = Cislo.objects.filter(rocnik = rocnik_obj, cislo = cislo).first() + vys = VysledkyKCisluOdjakziva.objects.filter(resitel = resitel, cislo = cislo_obj).first() if vys == None: body = 0 else: