コード例 #1
0
ファイル: edit.py プロジェクト: JeffreiToledo/Jeff_Script
def save(_handler, clothing_id, **clothing_properties):
    cmd = facade.update_clothing_cmd(clothing_id, **clothing_properties)
    try:
        cmd()
    except CommandExecutionException:
        context = {'errors': cmd.errors,
                   'clothing': cmd.form}

        return TemplateResponse(context, 'clothings/admin/form.html')
    _handler.redirect(router.to_path(admin))
コード例 #2
0
ファイル: rest.py プロジェクト: JeffreiToledo/Jeff_Script
def update(clothing_id, **clothing_properties):
    cmd = facade.update_clothing_cmd(clothing_id, **clothing_properties)
    return _save_or_update_json_response(cmd)