Exemplo n.º 1
0
class OrganizationViewSet(Resource):
    def __init__(self):
        self.requests = OrganizationRequests()

    def get(self):
        return {'status':'success','data':self.requests.organizations()}

    def post(self):
        _name = request.form['name']
        _image = request.form['image']
        return {'status':'success',
                'data':Organization.create(name=_name,
                                   image=_image).dict() }

    def delete(self):
        return {'status':'success'}
Exemplo n.º 2
0
 def __init__(self):
     self.requests = OrganizationRequests()