Created
October 21, 2018 10:07
-
-
Save lokhmakov/eda4698c736816ed28837f14754b6461 to your computer and use it in GitHub Desktop.
models/CoreField.js
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') | |
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