def add_comment(): com = Comment(**request.get_json()) com.save() return jsonify(**com.to_dict()), 201
def get_all_comments(website, page): coms = Comment.objects(website=website, page=page) return jsonify(comments=[com.to_dict() for com in coms])