Skip to content

Instantly share code, notes, and snippets.

@lokhmakov
Created October 21, 2018 10:07
Show Gist options
  • Save lokhmakov/eda4698c736816ed28837f14754b6461 to your computer and use it in GitHub Desktop.
Save lokhmakov/eda4698c736816ed28837f14754b6461 to your computer and use it in GitHub Desktop.
models/CoreField.js
var keystone = require('keystone')
var Types = keystone.Field.Types
var CoreField = new keystone.List('CoreField')
const typeList = [
`Boolean`,
`String`,
`Date`,
`Number`,
]
CoreField.add({
name: { type: String, required: true, index: true, },
type: { type: Types.Select, options: typeList.join(', ') },
entity: { type: Types.Relationship, ref: 'CoreEntity', },
})
CoreField.defaultColumns = 'name'
CoreField.register()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment