minor improvement
This commit is contained in:
parent
94461c66f6
commit
1c5679f71f
@ -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")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user