From fcd618db18a169f1be4cd32b5f33528cb11cceec Mon Sep 17 00:00:00 2001 From: vincent Date: Tue, 1 Jun 2021 14:15:29 +0200 Subject: [PATCH] correct type datetime --- ITPlanning/db.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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