Closed noppoMan closed 9 years ago
Support both of static and prototype custom properties extend for ORM like bellow.
npdynamodb.define('model', { dynamodb: require('./dynamodb_2012_08_10'), hashKey: 'hash_key', rangeKey: 'range_key', customProtoConstant: 1, customProtoMethod: function(){ return this.get('hash_key') === 1; } }, { customStaticConstant: 1, customStaticMethod: function(){ return this.where('hash_key', 1).fetch(); } }); // Usecase Model.find(1).fetch().then(funciton(model){ model.customProtoMethod(); }); Model.customStaticMethod();
Done at 5d51551.
Support both of static and prototype custom properties extend for ORM like bellow.