From d72faeaed3ed62003f33fe1e554adb406f7404f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Mon, 4 Oct 2021 22:35:59 +0200 Subject: [PATCH] Delete old_views.py --- seminar/old_views.py | 71 -------------------------------------------- 1 file changed, 71 deletions(-) delete mode 100644 seminar/old_views.py diff --git a/seminar/old_views.py b/seminar/old_views.py deleted file mode 100644 index f904d137..00000000 --- a/seminar/old_views.py +++ /dev/null @@ -1,71 +0,0 @@ -# Tento soubor slouží k odkládání aktuálně nepotřebného kódu, který by -# se však v budoucnu mohl opět hodit. - -################################################################### - -## Prispevek byl zrusen, mozna ale bude podobny nahled na neco jineho. -#class PrispevekView(generic.DetailView): -# model = Prispevek -# template_name = 'seminar/archiv/prispevek.html' -# -# # Vlastni ziskavani objektu z databaze podle prispevku -# # pokud je prispevek neverejny zobrazi se jenom orgum -# def get_object(self, queryset=None): -# if queryset is None: -# queryset = self.get_queryset() -# problem_arg = self.kwargs.get('pk') -# prispevek_arg = self.kwargs.get('prispevek') -# queryset = queryset.filter(pk=prispevek_arg) -# -# try: -# obj = queryset.get() -# except queryset.model.DoesNotExist: -# raise Http404(_("No %(verbose_name)s found matching the query") % -# {'verbose_name': queryset.model._meta.verbose_name}) -# -# if self.request.user.is_staff or obj.zverejnit: -# return obj -# else: -# raise Http404() -# -# def get_context_data(self, **kwargs): -# context = super(PrispevekView, self).get_context_data(**kwargs) -# # snaho o ziskani titulu -# titul = '' -# try: -# resitel = context['prispevek'].reseni.resitel -# cislo = context['prispevek'].reseni.cislo_body -# body = VysledkyKCisluOdjakziva.objects.get(resitel=resitel, -# cislo=cislo).body -# titul = resitel.get_titul(body) -# except: -# pass -# context['titul'] = titul -# return context - -#################################################################### - -## Stvrzenky aktuálně nevydáváme, ale možná časem zase budeme. -#def soustredeniStvrzenkyExportView(request,soustredeni,first_num): -# first_num = int(first_num) -# soustredeni = get_object_or_404(Soustredeni,id = soustredeni) -# ucastnici = Resitel.objects.filter(soustredeni=soustredeni) -# for (idx,u) in enumerate(ucastnici): -# u.cislo_stvrzenky = first_num+idx; -# tex = render(request,'seminar/soustredeni/ucastnici.tex', {'ucastnici': ucastnici, 'datum':soustredeni.datum_zacatku }).content -# -# tempdir = tempfile.mkdtemp() -# with open(tempdir+"/ucastnici.tex","w") as texfile: -# # Pokud TeX chce ISO Latin, tak se da encode nastavit -# texfile.write(tex.decode("utf-8").encode("utf-8")) -# shutil.copy(os.path.join(settings.STATIC_ROOT, 'seminar/stvrzenka.sty'),tempdir) -# shutil.copy(os.path.join(settings.STATIC_ROOT, 'seminar/stvrzenky.tex'),tempdir) -# subprocess.call(["cslatex","stvrzenky.tex"],cwd = tempdir) -# subprocess.call(["dvipdf","stvrzenky.dvi"],cwd = tempdir) -# -# with open(tempdir+"/stvrzenky.pdf","rb") as pdffile: -# response = HttpResponse(pdffile.read(),content_type='application/pdf') -# shutil.rmtree(tempdir) -# return response - -