Add get, in_ and contains method to PYSON

issue9576
review319911002
This commit is contained in:
Cédric Krier
2020-09-24 22:56:58 +02:00
parent 90bef2751e
commit 4eacdc96e2
2 changed files with 13 additions and 0 deletions
+1
View File
@@ -1,3 +1,4 @@
* Add get, in_ and contains methods to PYSON
* Manage deletable and writable state
* Support e-mail template
* Always encode CSV export in UTF-8
+12
View File
@@ -29,6 +29,18 @@
types: function() {
throw 'NotImplementedError';
},
get: function(k, d) {
if (d === undefined) {
d = '';
}
return Sao.PYSON.Get(this, k, d);
},
in_: function(obj) {
return Sao.PYSON.In(this, obj);
},
contains: function(k) {
return Sao.PYSON.In(k, this);
},
toString: function() {
var klass = this.pyson().__class__;
var args = this.__string_params__().map(Sao.PYSON.toString);