in json, return author_id and ids of replies
parent
fca27c37eb
commit
5b021432a4
|
@ -287,6 +287,7 @@ class Comment(Base):
|
||||||
data = {
|
data = {
|
||||||
'id': self.id,
|
'id': self.id,
|
||||||
'level': self.level,
|
'level': self.level,
|
||||||
|
'author_id': '👻' if self.ghost else self.author_id,
|
||||||
'author_name': self.author_name,
|
'author_name': self.author_name,
|
||||||
'body': self.body,
|
'body': self.body,
|
||||||
'body_html': self.body_html,
|
'body_html': self.body_html,
|
||||||
|
@ -305,7 +306,7 @@ class Comment(Base):
|
||||||
'downvotes': self.downvotes,
|
'downvotes': self.downvotes,
|
||||||
'is_bot': self.is_bot,
|
'is_bot': self.is_bot,
|
||||||
'reports': reports,
|
'reports': reports,
|
||||||
# 'replies': [x.json for x in self.replies(sort="old", v=None)] # WORKER TIMEOUTS ON BUGTHREAD
|
'replies': [x.id for x in self.replies(sort="old")]
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.level >= 2: data['parent_comment_id'] = self.parent_comment_id
|
if self.level >= 2: data['parent_comment_id'] = self.parent_comment_id
|
||||||
|
|
|
@ -208,7 +208,9 @@ class Post(Base):
|
||||||
for r in self.reports:
|
for r in self.reports:
|
||||||
reports[r.user.username] = r.reason
|
reports[r.user.username] = r.reason
|
||||||
|
|
||||||
data = {'author_name': self.author_name,
|
data = {
|
||||||
|
'author_id': '👻' if self.ghost else self.author_id,
|
||||||
|
'author_name': self.author_name,
|
||||||
'permalink': self.permalink,
|
'permalink': self.permalink,
|
||||||
'shortlink': self.shortlink,
|
'shortlink': self.shortlink,
|
||||||
'is_banned': bool(self.is_banned),
|
'is_banned': bool(self.is_banned),
|
||||||
|
@ -237,7 +239,7 @@ class Post(Base):
|
||||||
}
|
}
|
||||||
|
|
||||||
if "replies" in self.__dict__:
|
if "replies" in self.__dict__:
|
||||||
data["replies"]=[x.json for x in self.replies]
|
data["replies"] = [x.json for x in self.replies]
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue