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'
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'