SHARE
TWEET

PostComments.js

christroutner Nov 25th, 2015 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var keystone = require('keystone');
  2. var Types = keystone.Field.Types;
  3.  
  4. /**
  5.  * Post Comments Model
  6.  * ===================
  7.  */
  8.  
  9. var PostComment = new keystone.List('PostComment', {
  10. //        nocreate: true
  11. });
  12.  
  13. PostComment.add({
  14.         post: { type: Types.Relationship, ref: 'Post', index: true },
  15.         date: { type: Types.Date, default: Date.now, index: true },
  16.         commentername: { type: String },
  17.         email: { type: Types.Email },
  18.         content: { type: Types.Markdown }
  19. });
  20.  
  21.  
  22. /**
  23.  * Registration
  24.  * ============
  25.  */
  26.  
  27. PostComment.defaultColumns = 'post, date|20%';
  28. PostComment.register();
RAW Paste Data
Top