def create_comment(comment, author, post_id): comment = Comment(comment=comment, post_id=post_id, author=author) comment.save() return comment.toJSON()