From 1c5679f71f07da8dbb8287c86661e78ab742ad97 Mon Sep 17 00:00:00 2001 From: eclipse Date: Sat, 24 May 2025 08:53:09 +0200 Subject: [PATCH] minor improvement --- the_works/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/the_works/models.py b/the_works/models.py index f6583d0..dba266c 100644 --- a/the_works/models.py +++ b/the_works/models.py @@ -8,7 +8,7 @@ def _asdict(self): d = {} for col in self.__table__.c: if type(col.type) == db.types.BLOB: - d[col.key] = "NULL" if self.__getattribute__(col.key) == None else f"Blob ({sys.getsizeof(self.__getattribute__(col.key))} Bytes)" + d[col.key] = "Blob (NULL)" if self.__getattribute__(col.key) == None else f"Blob ({sys.getsizeof(self.__getattribute__(col.key))} Bytes)" else: d[col.key] = self.__getattribute__(col.key) return d @@ -35,6 +35,7 @@ class Werk(db.Model): werksform = relationship("Werksform", back_populates="werk") veroeffentlichung = relationship("Veroeffentlichung", back_populates="werk") werk_genre = relationship("Werk_Genre", back_populates="werk", cascade="save-update, merge, delete, delete-orphan") +# titelbild = relationship("Titelbild", back_populates="werk", cascade="all, delete-orphan", single_parent=True) titelbild = relationship("Titelbild", back_populates="werk") genres = association_proxy("werk_genre", "Genre") werk_herausgeber = relationship("Werk_Herausgeber", back_populates="werk", cascade="save-update, merge, delete, delete-orphan")