parameters.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:ddots-api-server 作者: frol 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号