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
def __init__(self): self.image_service = ImageService()