{"size": 569, "ext": "js", "max_stars_repo_path": "models/Author.js", "max_stars_repo_name": "zharley/papers", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "models/Author.js", "max_issues_repo_name": "zharley/papers", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "models/Author.js", "max_forks_repo_name": "zharley/papers", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.8636363636, "max_line_length": 113, "alphanum_fraction": 0.6608084359}
var keystone = require('keystone');
var Types = keystone.Field.Types;

/**
 * Author Model
 * ==========
 */
var Author = new keystone.List('Author');

Author.add({
  name: { type: Types.Text, initial: true, required: true, index: true },
  email: { type: Types.Email, initial: true },
  affiliations: { type: Types.Relationship, ref: 'Organization', many: true, initial: true, createInline: true },
});

/**
 * Registration
 */
Author.relationship({ path: 'papers', ref: 'Paper', refPath: 'authors' });
Author.defaultColumns = 'name, affiliations';
Author.register();
