예제 #1
0
파일: edit.py 프로젝트: renzon/fatec-script
def save(_handler, categoria_id, **categoria_properties):
    cmd = facade.update_categoria_cmd(categoria_id, **categoria_properties)
    try:
        cmd()
    except CommandExecutionException:
        context = {'errors': cmd.errors,
                   'categoria': cmd.form}

        return TemplateResponse(context, 'categorias/admin/form.html')
    _handler.redirect(router.to_path(admin))
예제 #2
0
파일: rest.py 프로젝트: renzon/fatec-script
def update(categoria_id, **categoria_properties):
    cmd = facade.update_categoria_cmd(categoria_id, **categoria_properties)
    return _save_or_update_json_response(cmd)