|
|
@ -12,14 +12,12 @@ class ExportIndexView(generic.View): |
|
|
|
def get(self, request): |
|
|
|
|
|
|
|
ls = [] |
|
|
|
for r in Rocnik.objects.all(): |
|
|
|
if r.verejna_cisla(): |
|
|
|
url = reverse('seminar_export_rocnik', kwargs={'prvni_rok': r.prvni_rok}) |
|
|
|
ls.append(url.split('/')[-1]) |
|
|
|
for s in Soustredeni.objects.all(): |
|
|
|
if s.ucastnici.count() >= 1 and s.verejne: |
|
|
|
url = reverse('seminar_export_sous', kwargs={'datum_zacatku': s.datum_zacatku.isoformat()}) |
|
|
|
ls.append(url.split('/')[-1]) |
|
|
|
for r in Rocnik.objects.filter(exportovat = True): |
|
|
|
url = reverse('seminar_export_rocnik', kwargs={'prvni_rok': r.prvni_rok}) |
|
|
|
ls.append(url.split('/')[-1]) |
|
|
|
for s in Soustredeni.objects.filter(exportovat = True): |
|
|
|
url = reverse('seminar_export_sous', kwargs={'datum_zacatku': s.datum_zacatku.isoformat()}) |
|
|
|
ls.append(url.split('/')[-1]) |
|
|
|
|
|
|
|
return HttpResponse('\n'.join(ls) + '\n', content_type='text/plain; charset=utf-8') |
|
|
|
|
|
|
@ -45,9 +43,14 @@ class ExportSousView(generic.View): |
|
|
|
if dz is None: |
|
|
|
raise django.http.Http404() |
|
|
|
|
|
|
|
s = get_object_or_404(Soustredeni, datum_zacatku=dz) |
|
|
|
s = get_object_or_404(Soustredeni, datum_zacatku=dz, exportovat=True) |
|
|
|
|
|
|
|
of = default_ovvpfile('MaM.sous', s.rocnik) |
|
|
|
akce = {Soustredeni.TYP_JARNI: 'MaM.sous.jaro', |
|
|
|
Soustredeni.TYP_PODZIMNI: 'MaM.sous.podzim', |
|
|
|
Soustredeni.TYP_VIKEND: 'MaM.vikend', |
|
|
|
}[s.typ] |
|
|
|
|
|
|
|
of = default_ovvpfile(akce, s.rocnik) |
|
|
|
of.headers['x-event-begin'] = s.datum_zacatku.isoformat() |
|
|
|
of.headers['x-event-end'] = s.datum_konce.isoformat() |
|
|
|
of.headers['x-event-location'] = s.misto |
|
|
@ -70,8 +73,8 @@ class ExportRocnikView(generic.View): |
|
|
|
if pr is None: |
|
|
|
raise django.http.Http404() |
|
|
|
|
|
|
|
rocnik = get_object_or_404(Rocnik, prvni_rok=pr) |
|
|
|
cislo = rocnik.posledni_verejne_cislo() |
|
|
|
rocnik = get_object_or_404(Rocnik, prvni_rok=pr, exportovat=True) |
|
|
|
cislo = rocnik.posledni_zverejnena_vysledkovka_cislo() |
|
|
|
vysledky = VysledkyKCislu.objects.filter(cislo = cislo).select_related("resitel").order_by('-body_celkem').all() |
|
|
|
|
|
|
|
of = default_ovvpfile('MaM.rocnik', rocnik) |
|
|
|