Esempio n. 1
0
def getAllParts():
    if request.method == 'POST':
        return PartHandler().insertPart(request.form)
    else:
        if not request.args:
            return PartHandler().getAllParts()
        else:
            return PartHandler().searchParts(request.args)
Esempio n. 2
0
def getPartById(pid):
    if request.method == 'GET':
        return PartHandler().getPartById(pid)
    elif request.method == 'PUT':
        return PartHandler().updatePart(pid, request.form)
    elif request.method == 'DELETE':
        return PartHandler().deletePart(pid)
    else:
        return jsonify(Error="Method not allowed."), 405
Esempio n. 3
0
def getSuppliersByPartId(pid):
    return PartHandler().getSuppliersByPartId(pid)
Esempio n. 4
0
def getPartById(pid):
    return PartHandler().getPartById(pid)
Esempio n. 5
0
def getAllParts():
    if not request.args:
        return PartHandler().getAllParts()
    else:
        return PartHandler().searchParts(request.args)