Exemple #1
0
def save(tserver, match, fact):
    name = match['Content1']
    data = localdata.data or []
    data = {o['name']: o['value'] for o in data}
    if data:
        set_data(name, data)
    return 'OK'
Exemple #2
0
def save_profile(tserver, match, fact):
    name = match['Person2']
    data = localdata.data or []
    schema = get_schema('person', form=True)
    form = Form(schema)
    try:
        data = [(o['name'], o['value']) for o in data]
        data = form.validate(data)
    except ValidationFailure as e:
        return form.render()
    if data:
        set_data(name, data)
    return 'OK'