示例#1
0
def save(_handler, artigo_id=None, **artigo_properties):
    cmd = facade.save_artigo_cmd(**artigo_properties)
    try:
        cmd()
    except CommandExecutionException:
        context = {'errors': cmd.errors,
                   'artigo': cmd.form}

        return TemplateResponse(context, 'artigos/admin/form.html')
    _handler.redirect(router.to_path(admin))
示例#2
0
def save(**artigo_properties):
    cmd = facade.save_artigo_cmd(**artigo_properties)
    return _save_or_update_json_response(cmd)