Example #1
0
def getAllSpecificResources(rtype):
    if request.method == 'GET':
        if request.args:
            return ResourceHandler().searchResource(request.args)
        else:
            return ResourceHandler().getAllSpecificResources(rtype)
    elif request.method == 'POST':
        return ResourceHandler().insertResource(request.form)
    else:
        return jsonify(Error="Method not allowed"), 405
Example #2
0
def insertResource(rtype):
    if request.method == 'POST':
        return ResourceHandler().insertResourceJson(request.json, rtype)
    else:
        return jsonify(Error="Method not allowed"), 405
Example #3
0
def getResourceByKeyword(keyword):
    if request.method == 'GET':
        return ResourceHandler().getResourceByKeyword(keyword)
    else:
        return jsonify(Error="Method not allowed"), 405
Example #4
0
def getResourceBySupplierId(sid):
    if request.method == 'GET':
        return ResourceHandler().getResourceBySupplierId(sid)
    else:
        return jsonify(Error="Method not allowed"), 405
Example #5
0
def getSpecificResourceById(rid, rtype):
    if request.method == 'GET':
        return ResourceHandler().getSpecificResourceById(rid, rtype)
    else:
        return jsonify(Error="Method not allowed"), 405