Skip to content

Instantly share code, notes, and snippets.

@grantstandridge
Last active August 29, 2015 14:15
Show Gist options
  • Save grantstandridge/899cdb535bd7a16c82a4 to your computer and use it in GitHub Desktop.
Save grantstandridge/899cdb535bd7a16c82a4 to your computer and use it in GitHub Desktop.
var keystone = require('keystone');
/**
* SimpleThing Model
* ==========
*/
var SimpleThing = new keystone.List('SimpleThing', {
map: { name: 'title' },
autokey: { path: 'slug', from: 'title', unique: true },
singular: 'simplething',
plural: 'simplethings'
});
SimpleThing.add({
title: { type: String, required: true },
state: { type: Types.Select, options: 'draft, published, archived', default: 'draft', index: true },
author: { type: Types.Relationship, ref: 'User', index: true },
publishedDate: { type: Types.Date, index: true, dependsOn: { state: 'published' } },
content: {
brief: { type: Types.Html, wysiwyg: true, height: 150 },
extended: { type: Types.Html, wysiwyg: true, height: 400 }
}
});
SimpleThing.defaultColumns = 'title, state|20%, author|20%, publishedDate|20%';
SimpleThing.register();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment