add sqlalchemy as orm tool

This commit is contained in:
Thomas Peetz
2025-01-10 17:39:54 +01:00
parent a1e8474149
commit 2ae11e24ef
10 changed files with 281 additions and 172 deletions
+5 -2
View File
@@ -1,7 +1,8 @@
import mariadb
from PySide6.QtWidgets import QHBoxLayout, QCheckBox
from data import KontorDB
from database import KontorDB
from database.comic import Comic
class KontorModelConfig:
@@ -23,7 +24,7 @@ class KontorModelConfig:
def get_table_config(self):
if self._table_id is None:
self.get_table_id()
self.header = self.kontor_db.get_column_meta_data(self._table_id)
self.header = self.kontor_db.get_column_meta_data(self._table_id, self._table)
self.filter = self.kontor_db.get_filters(self._table_id)
def get_filter(self) -> str:
@@ -44,6 +45,8 @@ class KontorModelConfig:
def get_data(self) -> list:
data = self.kontor_db.get_data(self._table, self.header, self.get_filter())
print(f"KontorModelConfig.get_data: {len(data)}")
# comics = self.kontor_db.session.query(Comic).all()
# print(f'{len(comics)} Comics loaded')
return data
def get_filter_layout(self) -> QHBoxLayout: