django_orm.py 文件源码

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

项目:OneClickDTU 作者: satwikkansal 项目源码 文件源码
def locked_put(self, credentials, overwrite=False):
        """Write a Credentials to the datastore.

        Args:
            credentials: Credentials, the credentials to store.
            overwrite: Boolean, indicates whether you would like these
                       credentials to overwrite any existing stored
                       credentials.
        """
        args = {self.key_name: self.key_value}

        if overwrite:
            (entity,
             unused_is_new) = self.model_class.objects.get_or_create(**args)
        else:
            entity = self.model_class(**args)

        setattr(entity, self.property_name, credentials)
        entity.save()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号