Jonas Havelka
3 years ago
10 changed files with 53 additions and 35 deletions
@ -0,0 +1,3 @@ |
|||
""" |
|||
Obsahuje vše, co se týká aesopu (exportu, který po nás vyžaduje OPMK). |
|||
""" |
@ -0,0 +1,5 @@ |
|||
from django.apps import AppConfig |
|||
|
|||
|
|||
class AesopConfig(AppConfig): |
|||
name = 'aesop' |
@ -0,0 +1,20 @@ |
|||
from django.urls import path |
|||
from aesop import views |
|||
|
|||
urlpatterns = [ |
|||
path( |
|||
'aesop-export/mam-rocnik-<int:prvni_rok>.csv', |
|||
views.ExportRocnikView.as_view(), |
|||
name='seminar_export_rocnik' |
|||
), |
|||
path( |
|||
'aesop-export/mam-sous-<str:datum_zacatku>.csv', |
|||
views.ExportSousView.as_view(), |
|||
name='seminar_export_sous' |
|||
), |
|||
path( |
|||
'aesop-export/index.csv', |
|||
views.ExportIndexView.as_view(), |
|||
name='seminar_export_index' |
|||
), |
|||
] |
@ -0,0 +1,16 @@ |
|||
import datetime |
|||
|
|||
from django.utils.encoding import force_text |
|||
|
|||
from aesop.ovvpfile import OvvpFile |
|||
|
|||
|
|||
def default_ovvpfile(event, rocnik): |
|||
of = OvvpFile() |
|||
of.headers['version'] = '1' |
|||
of.headers['event'] = event |
|||
of.headers['year'] = force_text(rocnik.prvni_rok) |
|||
of.headers['date'] = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") |
|||
of.headers['id-scope'] = 'mam' |
|||
of.headers['id-generation'] = '1' |
|||
return of |
Loading…
Reference in new issue