def replace(cls, obj, field, value, state):
"""
This is method for replace operation. It is separated to provide a
possibility to easily override it in your Parameters.
Args:
obj (object): an instance to change.
field (str): field name
value (str): new value
state (dict): inter-operations state storage
Returns:
processing_status (bool): True
"""
if not hasattr(obj, field):
raise ValidationError("Field '%s' does not exist, so it cannot be patched" % field)
setattr(obj, field, value)
return True
评论列表
文章目录