def with_relative_values_for(self, **kwargs):
"""
Use relative values for the given set of attributes.
:param kwargs (attr_name -> function): A mapping of attibute names to functions of a single dictionary argument
containing all values already set for any given record so far. Fixed, random, and "extra" values. The
function should return the value you wnat to use for the attribute for that record.
:return: Generate
"""
ret = copy.copy(self)
ret.relative_values = copy.copy(ret.relative_values)
ret.relative_values.append(kwargs)
return ret
评论列表
文章目录