Changed the names of the files to conform the python convection and also added photo_in_entry.py to diminish the cyclic import error in pylint

This commit is contained in:
Gustavo Henrique Santos Souza de Miranda
2025-06-04 00:13:18 -03:00
parent 89e6d0a783
commit ac29e84833
11 changed files with 66 additions and 45 deletions
+21
View File
@@ -0,0 +1,21 @@
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
Base = declarative_base()
class Database:
def __init__(self):
self.engine = create_engine(
"sqlite:///database.db",
echo=False,
connect_args={"check_same_thread": False},
)
self.session = sessionmaker(bind=self.engine, autoflush=False, autocommit=False)
def create(self):
Base.metadata.create_all(self.engine)
def get_db(self):
return self.session()