record.py 文件源码

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

项目:odoo-rpc-client 作者: katyukha 项目源码 文件源码
def insert(self, index, item):
        """ Insert record to list

            :param item: Record instance to be inserted into list.
                         if int passed, it considered to be ID of record
            :type item: Record|int
            :param int index: position where to place new element
            :return: self
            :rtype: RecordList
        """
        assert isinstance(item, (Record, numbers.Integral)), \
            "Only Record or int instances could be added to list"
        if isinstance(item, Record):
            self._records.insert(index, item)
        else:
            self._records.insert(index, self._object.read_records(
                item, cache=self._cache))
        return self

    # Overridden to make ability to call methods of object on list of IDs
    # present in this RecordList
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号