correct type datetime

This commit is contained in:
vincent 2021-06-01 14:15:29 +02:00
parent 438fd2c6e4
commit fcd618db18

View File

@ -38,7 +38,7 @@ class Appointment(db.Entity):
id = PrimaryKey(int, auto=True) id = PrimaryKey(int, auto=True)
book_datetime = Required(datetime) book_datetime = Required(datetime)
start_datetime = Required(datetime) start_datetime = Required(datetime)
end_datetime = Required(str) end_datetime = Required(datetime)
localisation = Optional(str, nullable=True) localisation = Optional(str, nullable=True)
is_unavaillable = Required(bool) is_unavaillable = Required(bool)
service = Required(Service) service = Required(Service)
@ -128,6 +128,7 @@ def parse_uri(database_uri):
def init_database(database_uri): def init_database(database_uri):
settings = parse_uri(database_uri) settings = parse_uri(database_uri)
db.bind(**settings) db.bind(**settings)
db.generate_mapping(check_tables=False) db.generate_mapping(check_tables=False)
try: try:
@ -138,3 +139,5 @@ def init_database(database_uri):
def release_database(): def release_database():
db.disconnect() db.disconnect()
db.provider = None
db.schema = None