Initial commit

This commit is contained in:
zhongjin
2020-06-15 10:58:47 +08:00
commit 4f1dfe7564
8590 changed files with 1516878 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
var Backbone = require('backbone');
var UsersGroup = require('./users-group-collection');
/**
* Model representing a group.
* Expected to be used in the context of a groups collection (e.g. OrganizationGroups),
* which defines its API endpoint path.
*/
module.exports = Backbone.Model.extend({
defaults: {
display_name: ''
},
initialize: function (attrs, opts) {
this.parse(attrs || {}, opts); // handle given attrs in the same way as for .fetch()
},
parse: function (attrs, opts) {
this.users = new UsersGroup(attrs.users, {
group: this,
configModel: opts.configModel,
organization: opts.organization
});
return attrs;
}
});