Last active
August 29, 2015 14:15
-
-
Save grantstandridge/899cdb535bd7a16c82a4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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