summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/framework/pyeval.js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2016-03-24 16:53:45 +0100
committerChristophe Simonis <chs@odoo.com>2016-03-24 16:53:45 +0100
commitddb0fb273982399f7618a017eeb81d6a5253575a (patch)
treef62aea4a3888d45e8bfe0f17baeb4ab9d0b47f41 /addons/web/static/src/js/framework/pyeval.js
parentd8137d35b7cc30df258fc310074eca3bfd88ec7a (diff)
parent59d3f63c58b47dfc1991494f167216cc1d9a9469 (diff)
[MERGE] forward port of branch saas-9 up to 59d3f63
Diffstat (limited to 'addons/web/static/src/js/framework/pyeval.js')
-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;