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