I have two Models
我有两个模型
/**
* Page Model
* =============
*/
var Page = new keystone.List('Page');
Page.add({
name: { type: String, required: true },
pid: { type: String, required: true , default:"123" },
phone: { type: String },
keyword : {type: Types.Relationship, ref: 'Keyword' , many: true},
searchvol : {type: Types.Relationship, ref: 'Keyword' , many: true},
pageType: { type: Types.Select, options: [
{ value: 'message', label: 'Just leaving a message' },
{ value: 'question', label: 'I\'ve got a question' },
{ value: 'other', label: 'Something else...' }
] },
createdAt: { type: Date, default: Date.now }
});
Page.relationship({ path: 'keywords', ref: 'Keyword', refPath: 'keyword' });
Page.relationship({ path: 'keywords', ref: 'Keyword', refPath: 'searchvol' });
/**
* Page Model