From 358ecaa1e358843d03dc8f1e1ed81489a0a5e357 Mon Sep 17 00:00:00 2001 From: "Bc. Petr Pecha" Date: Sun, 15 Nov 2015 16:14:07 +0100 Subject: [PATCH] tituly | view --- seminar/templates/seminar/archiv/Tituly.tex | 0 seminar/urls.py | 5 ++++- seminar/views.py | 15 +++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 seminar/templates/seminar/archiv/Tituly.tex diff --git a/seminar/templates/seminar/archiv/Tituly.tex b/seminar/templates/seminar/archiv/Tituly.tex new file mode 100644 index 00000000..e69de29b diff --git a/seminar/urls.py b/seminar/urls.py index 04f04292..bf5f113e 100644 --- a/seminar/urls.py +++ b/seminar/urls.py @@ -36,5 +36,8 @@ urlpatterns = patterns('', url(r'^aesop-export/mam-sous-(?P[\d-]+)\.csv$', export.ExportSousView.as_view(), name='seminar_export_sous'), url(r'^aesop-export/index.csv$', export.ExportIndexView.as_view(), name='seminar_export_index'), url(r'^cislo/(?P\d+).(?P\d+)/vysledkovka.tex$', views.CisloVysledkovkaView.as_view(), name='seminar_cislo_vysledkovka'), - url(r'^cislo/(?P\d+).(?P\d+)/obalky.pdf$',views.cisloObalkyView, name='seminar_cislo_obalky') + url(r'^cislo/(?P\d+).(?P\d+)/obalky.pdf$',views.cisloObalkyView, name='seminar_cislo_obalky'), + + url(r'^cislo/(?P\d+).(?P\d+)/tituly.tex$', views.TitulyView, + name='seminar_cislo_titul'), ) diff --git a/seminar/views.py b/seminar/views.py index 59941fdf..8a625909 100644 --- a/seminar/views.py +++ b/seminar/views.py @@ -380,6 +380,21 @@ def obalkyView(request,resitele): shutil.rmtree(tempdir) return response +### Tituly + +def TitulyView(request, rocnik, cislo): + resitele = Resitel.objects.all() + for resitel in resitele: + rocnik_obj = Rocnik.objects.filter(rocnik = rocnik) + cislo_obj = Cislo.objects.filter(rocnik = rocnik_obj, cislo = cislo).first() + body = VysledkyKCisluOdjakziva.objects.filter(resitel = resitel, cislo = cislo_obj).first().body + resitel.titul = resitel.get_titul(body) + + return render(request, 'seminar/archiv/Tituly.tex', + {'resitele': resitele, + } + ) + ### Soustredeni