zcash-grant-system/backend/grant/comment/views.py

15 lines
365 B
Python
Raw Normal View History

from flask import Blueprint
from flask_yoloapi import endpoint
2018-09-10 09:55:26 -07:00
from .models import Comment, comments_schema
2018-09-18 15:20:17 -07:00
blueprint = Blueprint("comment", __name__, url_prefix="/api/v1/comment")
2018-09-10 09:55:26 -07:00
@blueprint.route("/", methods=["GET"])
@endpoint.api()
2018-09-10 09:55:26 -07:00
def get_comments():
all_comments = Comment.query.all()
result = comments_schema.dump(all_comments)
return result