
Untitled
By: a guest on
May 5th, 2012 | syntax:
None | size: 0.95 KB | hits: 10 | expires: Never
answerMe.models.Question = Ext.regModel('Question', {
fields: [
{
name: 'title',
type: 'string'
},
{
name: 'id',
type: 'int'
},
{
name: 'description',
type: 'string'
},
{
name: 'tag_list',
type: 'array'
}
],
// associations: [
// {
// type: 'hasMany',
// model: 'Answer',
// name: 'answers'
// }],
validations: [
{
type: 'presence',
field: 'title'
},
{
type: 'presence',
field: 'description'
},
{
type: 'presence',
field: 'tag_list',
}
],
proxy: {
type: 'ajax',
url : 'questions',
reader: {
type: 'json',
record: 'question'
},
writer: {
root: 'questions',
type: 'json',
record: 'question'
}
}
});