'This can be called from a plugin to add set values to an entry'

def modify(self, entry, config, errors=True):

    for field in config:
        if ((not isinstance(config[field], basestring)) or (u'{' not in config[field])):
            entry[field] = config[field]
        else:
            orig_value = entry.get(field, UNSET, eval_lazy=False)
            try:
                del entry[field]
            except KeyError:
                pass
            entry.register_lazy_func(partial(self.lazy_set, config, field, orig_value, errors=errors), config)
