Пример #1
0
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
def update(clothing_id, **clothing_properties):
    cmd = facade.update_clothing_cmd(clothing_id, **clothing_properties)
    return _save_or_update_json_response(cmd)