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)
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
def getSuppliersByPartId(pid): return PartHandler().getSuppliersByPartId(pid)
def getPartById(pid): return PartHandler().getPartById(pid)
def getAllParts(): if not request.args: return PartHandler().getAllParts() else: return PartHandler().searchParts(request.args)