pain
This commit is contained in:
parent
29e34eeac9
commit
6ef1f41bf6
2 changed files with 6 additions and 6 deletions
|
@ -54,7 +54,7 @@ class Comment(Base):
|
|||
author = relationship("User", primaryjoin="User.id==Comment.author_id")
|
||||
senttouser = relationship("User", primaryjoin="User.id==Comment.sentto", viewonly=True)
|
||||
parent_comment = relationship("Comment", remote_side=[id], viewonly=True)
|
||||
child_comments = relationship("Comment", remote_side=[parent_comment_id], viewonly=True)
|
||||
child_comments = relationship("Comment", lazy="dynamic", remote_side=[parent_comment_id], viewonly=True)
|
||||
awards = relationship("AwardRelationship", viewonly=True)
|
||||
reports = relationship("CommentFlag", viewonly=True)
|
||||
|
||||
|
|
|
@ -124,13 +124,13 @@ def notifications(v):
|
|||
listing = []
|
||||
for c in comments:
|
||||
if c.parent_submission:
|
||||
c.replies2 = [x for x in c.child_comments if c.author_id == v.id or x.id in all]
|
||||
if c.id == 1661969: print(c.replies2)
|
||||
cids = cids | set(x.id for x in c.replies2)
|
||||
if not c.replies2:
|
||||
c.replies2 = c.child_comments.filter(Comment.author_id == v.id, Comment.id.in_(all)).all()
|
||||
cids.update(x.id for x in c.replies2)
|
||||
while c.parent_comment and (c.parent_comment.author_id == v.id or c.parent_comment in comments):
|
||||
c = c.parent_comment
|
||||
c.replies2 = [x for x in c.child_comments if c.author_id == v.id or x.id in all]
|
||||
cids = cids | set(x.id for x in c.replies2)
|
||||
c.replies2 = c.child_comments.filter(Comment.author_id == v.id, Comment.id.in_(all)).all()
|
||||
cids.update(x.id for x in c.replies2)
|
||||
cids.add(c.id)
|
||||
else:
|
||||
while c.parent_comment:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue