From da9ccbd0cc298395ba86293090ba001f68fd9cf5 Mon Sep 17 00:00:00 2001 From: Untone Date: Tue, 20 Feb 2024 10:52:30 +0300 Subject: [PATCH] ratings-model-fix --- orm/author.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orm/author.py b/orm/author.py index df6b4067..71c31b03 100644 --- a/orm/author.py +++ b/orm/author.py @@ -38,7 +38,7 @@ class Author(Base): pic = Column(String, nullable=True, comment='Picture') links = Column(JSON, nullable=True, comment='Links') - ratings = relationship(AuthorRating, foreign_keys=AuthorRating.author) + ratings = relationship(AuthorRating, foreign_keys=AuthorRating.author, backref="author", cascade="all, delete-orphan", passive_deletes=True) created_at = Column(Integer, nullable=False, default=lambda: int(time.time())) last_seen = Column(Integer, nullable=False, default=lambda: int(time.time()))