|
@ -19,7 +19,7 @@ import subprocess |
|
|
import shutil |
|
|
import shutil |
|
|
import os |
|
|
import os |
|
|
from django.conf import settings |
|
|
from django.conf import settings |
|
|
|
|
|
import unicodedata |
|
|
|
|
|
|
|
|
def verejna_temata(rocnik): |
|
|
def verejna_temata(rocnik): |
|
|
"""Vrací queryset zveřejněných témat v daném ročníku. |
|
|
"""Vrací queryset zveřejněných témat v daném ročníku. |
|
@ -350,13 +350,15 @@ def cisloObalkyView(request,rocnik,cislo): |
|
|
letos = CisloObalkyStruct() |
|
|
letos = CisloObalkyStruct() |
|
|
loni = CisloObalkyStruct() |
|
|
loni = CisloObalkyStruct() |
|
|
|
|
|
|
|
|
letos.rocnik = Rocnik.objects.filter(rocnik = rocnik) |
|
|
letos.rocnik = Rocnik.objects.filter(rocnik = rocnik)[0] |
|
|
loni.rocnik = Rocnik.objects.filter(rocnik = int(rocnik)-1) |
|
|
loni.rocnik = Rocnik.objects.filter(rocnik = int(rocnik)-1)[0] |
|
|
letos.problemy = Problem.objects.filter(cislo_zadani = Cislo.objects.filter(rocnik=letos.rocnik,cislo__lte = cislo)) |
|
|
letos.problemy = Problem.objects.filter(cislo_zadani = Cislo.objects.filter(rocnik=letos.rocnik,cislo__lte = cislo)) |
|
|
loni.problemy = Problem.objects.filter(cislo_zadani = Cislo.objects.filter(rocnik=loni.rocnik)) |
|
|
loni.problemy = Problem.objects.filter(cislo_zadani = Cislo.objects.filter(rocnik=loni.rocnik)) |
|
|
letos.resitele = Resitel.objects.filter(reseni = Reseni.objects.filter(problem=letos.problemy)).distinct() |
|
|
letos.resitele = Resitel.objects.filter(reseni = Reseni.objects.filter(problem=letos.problemy)).distinct() |
|
|
loni.resitele = Resitel.objects.filter(reseni = Reseni.objects.filter(problem=loni.problemy)).distinct() |
|
|
loni.resitele = Resitel.objects.filter(reseni = Reseni.objects.filter(problem=loni.problemy)).distinct() |
|
|
|
|
|
|
|
|
|
|
|
loni.resitele = loni.resitele.filter(rok_maturity__gt = letos.rocnik.prvni_rok) |
|
|
|
|
|
|
|
|
if int(cislo) > 3: |
|
|
if int(cislo) > 3: |
|
|
resitele = letos.resitele |
|
|
resitele = letos.resitele |
|
|
else: |
|
|
else: |
|
@ -383,17 +385,20 @@ def obalkyView(request,resitele): |
|
|
### Tituly |
|
|
### Tituly |
|
|
|
|
|
|
|
|
def TitulyView(request, rocnik, cislo): |
|
|
def TitulyView(request, rocnik, cislo): |
|
|
resitele = Resitel.objects.all() |
|
|
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: |
|
|
for resitel in resitele: |
|
|
rocnik_obj = Rocnik.objects.filter(rocnik = rocnik) |
|
|
vys = VysledkyKCisluOdjakziva.objects.filter(resitel = resitele, cislo = cislo_obj).first() |
|
|
cislo_obj = Cislo.objects.filter(rocnik = rocnik_obj, cislo = cislo).first() |
|
|
if vys == None: |
|
|
body = VysledkyKCisluOdjakziva.objects.filter(resitel = resitel, cislo = cislo_obj).first().body |
|
|
body = 0 |
|
|
|
|
|
else: |
|
|
|
|
|
body = vys.body |
|
|
resitel.titul = resitel.get_titul(body) |
|
|
resitel.titul = resitel.get_titul(body) |
|
|
|
|
|
resitel.ascii = unicodedata.normalize('NFKD',resitel.jmeno+resitel.prijmeni).encode("ascii","ignore").replace(" ","") |
|
|
|
|
|
|
|
|
return render(request, 'seminar/archiv/Tituly.tex', |
|
|
return render(request, 'seminar/archiv/tituly.tex',{'resitele': resitele}) |
|
|
{'resitele': resitele, |
|
|
|
|
|
} |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Soustredeni |
|
|
### Soustredeni |
|
|