summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/framework
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2016-03-16 16:11:12 +0100
committerChristophe Simonis <chs@odoo.com>2016-03-16 16:11:12 +0100
commit1a3e807fc2117a8d0be00e2ced9dbbae6f3589ba (patch)
tree3cb1bab30b4aae3368febd4356aad67f29b04136 /addons/web/static/src/js/framework
parentadddfa0d8b6f0b323c032409302b1b37d0b85601 (diff)
parent5238b77430bf42589a8772d55d9ebd8dde8e9cf5 (diff)
[MERGE] forward port of branch saas-7 up to 5238b77
Diffstat (limited to 'addons/web/static/src/js/framework')
-rw-r--r--addons/web/static/src/js/framework/pyeval.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/addons/web/static/src/js/framework/pyeval.js b/addons/web/static/src/js/framework/pyeval.js
index ce25e7af534..2b553d37e0f 100644
--- a/addons/web/static/src/js/framework/pyeval.js
+++ b/addons/web/static/src/js/framework/pyeval.js
@@ -757,6 +757,12 @@ var wrapping_dict = py.type('wrapping_dict', null, {
__getattr__: function (key) {
return this.__getitem__(py.str.fromJSON(key));
},
+ __len__: function () {
+ return Object.keys(this._store).length
+ },
+ __nonzero__: function () {
+ return py.PY_size(this) > 0 ? py.True : py.False;
+ },
get: function () {
var args = py.PY_parseArgs(arguments, ['k', ['d', py.None]]);
@@ -780,6 +786,12 @@ var wrapping_list = py.type('wrapping_list', null, {
__getitem__: function (index) {
return wrap(this._store[index.toJSON()]);
},
+ __len__: function () {
+ return this._store.length;
+ },
+ __nonzero__: function () {
+ return py.PY_size(this) > 0 ? py.True : py.False;
+ },
fromJSON: function (ar) {
var instance = py.PY_call(wrapping_list);
instance._store = ar;