flaschengeist/geruecht/controller/mainController/mainRegistrationController.py

14 lines
619 B
Python
Raw Permalink Normal View History

2020-06-17 18:25:29 +00:00
from datetime import date
import geruecht.controller.databaseController as dc
from geruecht.logger import getDebugLogger
db = dc.DatabaseController()
debug = getDebugLogger()
class Base:
def setNewRegistration(self, data):
debug.info("set new registration {{ {} }}".format(data))
data['birthDate'] = date(int(data['birthDate']['year']), int(data['birthDate']['month']), int(data['birthDate']['day']))
data['entryDate'] = date(int(data['entryDate']['year']), int(data['entryDate']['month']), int(data['entryDate']['day'])) if data['entryDate'] else None
db.setNewRegistration(data)