Пример #1
0
def get_comment_by_id(id):
    comment = Comments.query.get(id)
    if not comment:
        raise PageNotFoundError()
    data, _ = read_comment_serializer.dump(comment)
    return jsonify(data=data)
Пример #2
0
def get_comments():
    comments = Comments.query.all()
    data, _ = read_comment_serializer.dump(comments, many=True)
    return jsonify(data=data)