From 767f65d5248a025131808bf84f86b73b50fbbc3e Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 30 Jul 2021 07:23:17 +0200 Subject: [PATCH] dsdsd --- drama/classes/comment.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drama/classes/comment.py b/drama/classes/comment.py index 9c1558847..88900c2c2 100644 --- a/drama/classes/comment.py +++ b/drama/classes/comment.py @@ -32,7 +32,6 @@ class Comment(Base, Age_times, Scores, Stndrd, Fuzzing): parent_submission = Column(Integer, ForeignKey("submissions.id")) # this column is foreignkeyed to comment(id) but we can't do that yet as # "comment" class isn't yet defined - parent_fullname = Column(Integer) created_utc = Column(Integer, default=0) edited_utc = Column(Integer, default=0) is_banned = Column(Boolean, default=False) @@ -111,6 +110,13 @@ class Comment(Base, Age_times, Scores, Stndrd, Fuzzing): else: return g.db.query(Comment).get(self.parent_comment_id) + @property + @lazy + def parent_fullname(self): + if self.parent_comment_id: return "t3_" + self.parent_comment_id + elif self.parent_submission: return "t2_" + self.parent_submission + + @property def replies(self):