mamweb/aesop/utils.py

17 lines
440 B
Python
Raw Normal View History

2021-10-05 00:25:15 +02:00
import datetime
from django.utils.encoding import force_str
2021-10-05 00:25:15 +02:00
from aesop.ovvpfile import OvvpFile
def default_ovvpfile(event, rocnik):
of = OvvpFile()
of.headers['version'] = '1'
of.headers['event'] = event
of.headers['year'] = force_str(rocnik.prvni_rok)
2021-10-05 00:25:15 +02:00
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