📜  ORM Read() 方法是如何工作的? - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:19.910000             🧑  作者: Mango

代码示例1
def read(self, cr, uid, ids, fields=None, context=None, load='_classic_read'):
    if context is None:
        context = {}
    res = super(product_category, self).read(cr, uid, ids, fields=fields, context=context, load=load)
    idx = 0
    for r in res:
        if r.has_key('name'):
            r['name'] = '***' + r['name']
            #replace line above with replacement value from external database
        res[idx] = r
        idx = idx + 1
    return res