File: //var/dev/irantv2.com/rest/api/models/Person.js
/**
* Person.js
*
* @description :: TODO: You might write a short summary of how this model works and what it represents here.
* @docs :: http://sailsjs.org/documentation/concepts/models-and-orm/models
*/
module.exports = {
attributes: {
title: {
type: 'string',
},
altTitles: {
type: 'json',
columnType: 'array',
},
poster: {
type: 'string',
allowNull: true
},
desc: {
type: 'string',
allowNull: true
},
birth: {
type: 'number',
allowNull: true
},
death: {
type: 'number',
allowNull: true
},
birthAccuracy: {
type: 'number',
allowNull: true
},
deathAccuracy: {
type: 'number',
allowNull: true
},
state: {
type: 'string',
isIn: ['draft', 'published'],
defaultsTo: 'published'
},
timelineState: {
type: 'string',
isIn: ['invisible', 'visible'],
defaultsTo: 'visible'
},
profession: {
type: 'string',
allowNull: true
},
articleTaqvim: {
type: 'string',
allowNull: true
},
articleDeja: {
type: 'string',
allowNull: true
},
articleDeba: {
type: 'string',
allowNull: true
},
tags: {
collection: 'tag',
via: 'persons',
dominant: true
},
places: {
collection: 'place',
via: 'person',
through: 'personplace',
},
books: {
collection: 'book',
via: 'person',
through: 'personbook',
},
articles: {
collection: 'article',
via: 'persons',
},
authoredArticles: {
collection: 'article',
via: 'author',
through: 'articleauthor',
},
episodes: {
collection: 'episode',
via: 'person',
through: 'episodeperson',
}
}
};