eventcally/project/api/image/resources.py
2021-01-27 16:09:43 +01:00

16 lines
465 B
Python

from project.api import add_api_resource
from flask_apispec import marshal_with, doc
from project.api.resources import BaseResource
from project.api.image.schemas import ImageSchema
from project.models import Image
class ImageResource(BaseResource):
@doc(summary="Get image", tags=["Images"])
@marshal_with(ImageSchema)
def get(self, id):
return Image.query.get_or_404(id)
add_api_resource(ImageResource, "/images/<int:id>", "api_v1_image")