[ADD] pluck method to collection
bzr revid: xmo@openerp.com-20110824122124-xr4g92x6jlw85rbg
This commit is contained in:
parent
ae4d1d5e3b
commit
2afcf2130b
|
@ -1437,6 +1437,11 @@ var Collection = openerp.base.Class.extend(/** @lends Collection# */{
|
||||||
});
|
});
|
||||||
return results;
|
return results;
|
||||||
},
|
},
|
||||||
|
pluck: function (fieldname) {
|
||||||
|
return this.map(function (record) {
|
||||||
|
return record.get(fieldname);
|
||||||
|
});
|
||||||
|
},
|
||||||
indexOf: function (record) {
|
indexOf: function (record) {
|
||||||
return _(this.records).indexOf(record);
|
return _(this.records).indexOf(record);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue