add sqlalchemy as orm tool
This commit is contained in:
+5
-2
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user