[ADD] pluck method to collection

bzr revid: xmo@openerp.com-20110824122124-xr4g92x6jlw85rbg
This commit is contained in:
Xavier Morel 2011-08-24 14:21:24 +02:00
parent ae4d1d5e3b
commit 2afcf2130b
1 changed files with 5 additions and 0 deletions

View File

@ -1437,6 +1437,11 @@ var Collection = openerp.base.Class.extend(/** @lends Collection# */{
});
return results;
},
pluck: function (fieldname) {
return this.map(function (record) {
return record.get(fieldname);
});
},
indexOf: function (record) {
return _(this.records).indexOf(record);
}