-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.js
28 lines (23 loc) · 1.12 KB
/
models.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//----------------------------------------------------------------------------------------------------------------------
// Models for the deluge-pages component
//
// @module models.js
//----------------------------------------------------------------------------------------------------------------------
var om = require('omega-models');
var fields = om.fields;
var SimpleBackend = om.backends.Simple;
var ns = om.namespace('deluge').backend(new SimpleBackend({ rootDir: './db' }));
//----------------------------------------------------------------------------------------------------------------------
module.exports = ns.define({
Page: {
title: fields.String(),
slug: fields.String({ key: true }),
content: fields.String(),
template: fields.String(),
draft: fields.Boolean({ default: true }),
created: fields.DateTime({ first: true }),
modified: fields.DateTime({ auto: true }),
owner: fields.Reference({ model: 'User' })
}
}); // end exports
//----------------------------------------------------------------------------------------------------------------------