From 4f0075966d251afd0a3c3e5a074a2897eb609d30 Mon Sep 17 00:00:00 2001 From: Deimos Date: Mon, 6 Aug 2018 16:44:14 -0600 Subject: [PATCH] Comment: Fix parent_comment relationship --- tildes/tildes/models/comment/comment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tildes/tildes/models/comment/comment.py b/tildes/tildes/models/comment/comment.py index 437ff40..b8788a7 100644 --- a/tildes/tildes/models/comment/comment.py +++ b/tildes/tildes/models/comment/comment.py @@ -97,7 +97,8 @@ class Comment(DatabaseModel): user: User = relationship('User', lazy=False, innerjoin=True) topic: Topic = relationship('Topic', innerjoin=True) - parent_comment: 'Comment' = relationship('Comment', innerjoin=True) + parent_comment: Optional['Comment'] = relationship( + 'Comment', uselist=False, remote_side=[comment_id]) @hybrid_property def markdown(self) -> str: