Slide 9
Slide 9 text
4 - Définition d’un …
… modèle !
sails generate person
Person.js :
module.exports = {
attributes : {
}
};
attributes: {
name : 'STRING',
age : {
type : 'INTEGER',
required : true
},
birthDate : 'DATE'
}
Types disponibles :
string, text, integer, float, date, time, datetime, boolean, binary, array, json
Validateurs disponibles :
empty, required, email, url, ip, notNull, regex, contains, minLength, maxLength …