remotes/1693045480750635534/spooky-22
Aevann1 2021-07-30 07:23:17 +02:00
parent 975c2255d1
commit 767f65d524
1 changed files with 7 additions and 1 deletions

View File

@ -32,7 +32,6 @@ class Comment(Base, Age_times, Scores, Stndrd, Fuzzing):
parent_submission = Column(Integer, ForeignKey("submissions.id")) parent_submission = Column(Integer, ForeignKey("submissions.id"))
# this column is foreignkeyed to comment(id) but we can't do that yet as # this column is foreignkeyed to comment(id) but we can't do that yet as
# "comment" class isn't yet defined # "comment" class isn't yet defined
parent_fullname = Column(Integer)
created_utc = Column(Integer, default=0) created_utc = Column(Integer, default=0)
edited_utc = Column(Integer, default=0) edited_utc = Column(Integer, default=0)
is_banned = Column(Boolean, default=False) 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) 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 @property
def replies(self): def replies(self):