This commit is contained in:
Aevann1 2021-09-17 14:36:39 +02:00
parent 7887014474
commit 11c1bbd203
11 changed files with 55 additions and 116 deletions

View file

@ -64,17 +64,10 @@ class AwardRelationship(Base):
comment_id = Column(Integer, ForeignKey("comments.id"), default=None)
kind = Column(String(20))
user = relationship("User", primaryjoin="AwardRelationship.user_id==User.id", lazy="joined")
post = relationship(
"Submission",
primaryjoin="AwardRelationship.submission_id==Submission.id",
lazy="joined"
)
comment = relationship(
"Comment",
primaryjoin="AwardRelationship.comment_id==Comment.id",
lazy="joined"
)
user = relationship("User", primaryjoin="AwardRelationship.user_id==User.id", lazy="joined", viewonly=True)
post = relationship("Submission", primaryjoin="AwardRelationship.submission_id==Submission.id", lazy="joined", viewonly=True)
comment = relationship("Comment", primaryjoin="AwardRelationship.comment_id==Comment.id", lazy="joined", viewonly=True)
@property
def given(self):