示例#1
0
class ImageListController(Resource):
    def __init__(self):
        self.image_service = ImageService()

    @marshal_with_field(fields.List(fields.Nested(Image.json_fields)))
    def get(self):
        images = self.image_service.getAll()

        return images

    @marshal_with(Image.json_fields)
    def post(self):
        image = self.image_service.create()

        return image
示例#2
0
 def __init__(self):
     self.image_service = ImageService()