예제 #1
0
def delete(id):
    """ Apaga aluno com id informado"""
    try:
        repositorio_alunos.delete(get_datastore_session(), repositorio_alunos.get(get_datastore_session(), id))
        return "Elemento Apagado"
    except ValueError:
        return None
예제 #2
0
def update(id):
    """ Atualiza aluno com id informado"""
    application = repositorio_alunos.update(get_datastore_session(), repositorio_alunos.get(get_datastore_session(), id), **request.json)
    return json.dumps(application, cls=JSONEncoder)
예제 #3
0
def get_id(id):
    """ Busca um aluno com id informado"""
    application = repositorio_alunos.get(get_datastore_session(), id)
    return json.dumps(application, cls=JSONEncoder)