Skip to content

Instantly share code, notes, and snippets.

@gregbarcza
Created January 16, 2014 10:08
Show Gist options
  • Save gregbarcza/8452537 to your computer and use it in GitHub Desktop.
Save gregbarcza/8452537 to your computer and use it in GitHub Desktop.
var keystone = require('keystone'),
Types = keystone.Field.Types;
var Category = new keystone.List('Category',{
map: { name: 'title' },
searchFields:'parent',
});
Category.add({
title: { type: String, required: true},
fqId: { type: String, index:true },
parent: { type: Types.Relationship, ref: 'Category'},
});
Category.defaultColumns = 'title, fqId, parent';
Category.register();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment