summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic/basic_controller.js
diff options
context:
space:
mode:
authorRaphael Collet <rco@odoo.com>2017-08-24 12:06:30 +0200
committerRaphael Collet <rco@odoo.com>2017-09-08 13:21:00 +0200
commit64e945aa446f53bb88843d690ad22cc58595e046 (patch)
tree00cd7686a89d7cba70c64bacc13495e0bb91c8fc /addons/web/static/src/js/views/basic/basic_controller.js
parent736e850a8ee4df1efeae41407a83bcde356d28bd (diff)
[REF] models: make the API of `RecordCache` more consistent
Make `RecordCache` work on a single record only, and implement a mapping from field names (only) to values. Also add explicit methods on `RecordCache` to wrap special behavior in cache, and simplify all special values as a wrapper for a getter function. The record cache may contain regular and special values. Modify `RecordCache` so that only methods ending with `_value` check for regular values. The dictionary methods considers both regular and special values as equivalent. name in record._cache # test if cache has a value iter(record._cache) # iterate on values record._cache[name] # get value record._cache.get(name) # get value or default record._cache.has_value(name) # test if cache has a regular value record._cache.get_value(name) # get regular value or default
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_controller.js')
0 files changed, 0 insertions, 0 deletions