我拼命地试图调用一个似乎不存在的简单的setter方法。
下面是我的模型定义:
var Process = Sequelize.MySql.define('Process',{
name: Sequelize.STRING,
description: Sequelize.TEXT,
duration: Sequelize.BIGINT,
status: {
type: Sequelize.ENUM(pstatus.unassigned,pstatus.assigned,pstatus.inprocess,pstatus.stopped,pstatus.finished),
defaultValue: pstatus.unassigned,
set: function(v){
console.log('Prozess status updated')
if(!pstatus.hasOwnProperty(v)){
return
}
this.setDataValue('status',v)
}
}
}process.setStatus(pStatus.inprocess)的每个调用都在TypeError中返回
可能是未处理的TypeError:对象对象SequelizeInstance没有方法“setStatus”
我在这里错过了什么?
发布于 2014-10-21 07:16:09
https://stackoverflow.com/questions/26474612
复制相似问题