使用反向关联时,getAdmin不起作用

时间:2015-11-11 12:27:40

标签: node.js express node-orm2

模型关联:

Entity_Department.hasOne('entity', db.models.entity, {reverse: 'entity_departments'});  

Entity_Department.hasOne('entity_location', db.models.entity_locations, {reverse:'admin'}); 

服务器端控制器:

Entity_Location.get(entity_locations_id, function(err, entity_locations){

    entity_locations.getAdmin(function(err, departments){

        for(var i = 0; i < departments.length; i++ ){
            departments[i].ede_is_deleted = true;
            departments[i].ede_updated_at = new Date();
        }

它表明getAdmin()不是函数。同样的概念适用于其他模型,所以我哪里出错?

0 个答案:

没有答案