From 496a71c47abd885b7183b8a20a0a1b4178578ab9 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Thu, 29 Dec 2022 21:31:05 +0200 Subject: [PATCH] Improve path --- slpkg/models/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/slpkg/models/models.py b/slpkg/models/models.py index 37f28f86..22b098a5 100644 --- a/slpkg/models/models.py +++ b/slpkg/models/models.py @@ -1,6 +1,8 @@ #!/usr/bin/python3 # -*- coding: utf-8 -*- +import os + from dataclasses import dataclass from sqlalchemy.orm import sessionmaker from sqlalchemy.ext.declarative import declarative_base @@ -9,10 +11,8 @@ from sqlalchemy import create_engine, Column, Integer, Text from slpkg.configs import Configs -db_path = Configs.db_path -database = Configs.database +DATABASE_URI = os.path.join(f'sqlite:///{Configs.db_path}', Configs.database) -DATABASE_URI = f'sqlite:///{db_path}/{database}' engine = create_engine(DATABASE_URI) session = sessionmaker(engine)()