Beispiel #1
0
def getAllAdministrators():
    if request.method == 'POST':
        return AdministratorHandler().insertAdministrator(request.form)
    else:
        if not request.args:
            return AdministratorHandler().getAllAdministrators()
        else:
            return AdministratorHandler().searchAdministrator(request.args)
Beispiel #2
0
def getAdministratorByID(ad_id):
    if request.method == 'GET':
        return AdministratorHandler().getAdministratorByID(ad_id)
    elif request.method == 'PUT':
        return AdministratorHandler().putAdministratorByID(request.form, ad_id)
    elif request.method == 'DELETE':
        return AdministratorHandler().deleteAdministratorByID(ad_id)
    else:
        return jsonify(Error="Method not allowed"), 405
def getAdministratorById(adid):
    if request.method == 'GET':
        return AdministratorHandler().getAdministratorById(adid)
    elif request.method == 'PUT':
        return AdministratorHandler().updateAdministrator(adid, request.form)
    elif request.method == 'DELETE':
        return UserHandler().deleteAdministrator(adid)
    else:
        return jsonify(Error="Method not allowed."), 405
Beispiel #4
0
def getALLAdministrator():
    if request.method == 'POST':
        print("Request: ", request.json)
        return AdministratorHandler().insertAdministrator(request.json)
    else:
        if not request.args:
            return AdministratorHandler().getAllAdministrators()
        else:
            return AdministratorHandler().searchAdministrator(request.json)
def getLatestAdministrator():
    return AdministratorHandler().getLatestAdministrator()