fix problem with closing subwindows and define field length for id in schema

This commit is contained in:
Thomas Peetz
2025-02-03 17:37:19 +01:00
parent 591171b223
commit f33aaadce7
5 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -168,7 +168,7 @@ class MainWindow(QMainWindow):
self.mdi_area.removeSubWindow(meta_data)
def remove_sub_window(self, name: str):
# self.log.info("remove subwindow %s", name)
self.log.info("remove subwindow %s", name)
if name in self._subwindows:
window = self._subwindows.pop(name)
window.close()
@@ -181,9 +181,9 @@ class MainWindow(QMainWindow):
import_dlg = ImportKontorDialog(self)
if import_dlg.exec():
print(f"import DB from file {import_dlg.file_name}")
self.kontor_db.import_db(import_dlg.file_name, False)
else:
print("do nothing for import")
pass
def export_to_file(self):
export_dlg = ExportKontorDialog(self, self.kontor_db)
+1 -1
View File
@@ -33,7 +33,7 @@ class MediaWindow(QMdiSubWindow):
def closeEvent(self, event):
self.closed.emit()
super().closeEvent(event)
self._main_window.remove_sub_window('comic')
self._main_window.remove_sub_window('media')
def refresh(self):
self.log.info("MediaWindow.refresh")
+1 -1
View File
@@ -33,7 +33,7 @@ class MetaDataWindow(QMdiSubWindow):
def closeEvent(self, event):
self.closed.emit()
super().closeEvent(event)
self._main_window.remove_sub_window('comic')
self._main_window.remove_sub_window('meta_data')
def refresh(self):
# self.log.info("refresh")
+1 -1
View File
@@ -35,7 +35,7 @@ class Token(Base, BaseMixin):
name = Column(String(255))
last_used_date: Mapped[datetime] = mapped_column()
enabled = Column(BIT(1))
user_id = Column(String, ForeignKey("user.id"), nullable=False)
user_id = Column(String(255), ForeignKey("user.id"), nullable=False)
user = relationship("User", back_populates="tokens")
+2 -2
View File
@@ -11,8 +11,8 @@ class Base(DeclarativeBase):
class BaseMixin:
# id = Column(String, primary_key=True)
id: Mapped[str] = mapped_column(primary_key=True, default=uuid.uuid4())
id = Column(String(255), primary_key=True, default=uuid.uuid4())
# id: Mapped[str] = mapped_column(primary_key=True, default=uuid.uuid4())
# created_date = Column(DateTime)
created_date: Mapped[datetime] = mapped_column(default=func.now())
# last_modified_date = Column(DateTime)