请问odoo好多地方用到了装饰器去监控字段的变化,比如象onchange
def onchange(*args):
return attrsetter('_onchange', args)
def attrsetter(attr, value):
""" Return a function that sets attr
on its argument and returns it. """
return lambda method: setattr(method, attr, value) or method
我看了一下这也只是给监听字段加了一个方法而已,具体实现逻辑是怎样的?字段变化时具体是如何触发的呢?