librelist archives

« back to archive

[bamboo]filter的bug

[bamboo]filter的bug

From:
Uno Young
Date:
2012-06-26 @ 10:02
Article:filter(function(u) return (u:getForeign('category') or
{}).name=='新闻中心' end)
出错:

stdin:1: attempt to call method 'getForeign' (a nil value)
stack traceback:
stdin:1: in function 'query_args'
/usr/local/share/lua/5.1/bamboo/model.lua:1088: in function
'checkLogicRelation'
/usr/local/share/lua/5.1/bamboo/model.lua:1628: in function 'walkcheck'
/usr/local/share/lua/5.1/bamboo/model.lua:1673: in function 'filter'
stdin:1: in main chunk
[C]: ?

Re: [bamboo]filter的bug

From:
Tang Daogang
Date:
2012-06-28 @ 14:28
原因在于,之前的设计是,当模型添加了  __use_rule_index = true;
后,会执行partialGot,而partialGot又没有将取得的对象部分 做成一个对象。造成不能使用getForeign.

已修正。

On Tue, Jun 26, 2012 at 6:02 PM, Uno Young <littlehaker@gmail.com> wrote:

> Article:filter(function(u) return (u:getForeign('category') or
> {}).name=='新闻中心' end)
> 出错:
>
> stdin:1: attempt to call method 'getForeign' (a nil value)
> stack traceback:
>  stdin:1: in function 'query_args'
> /usr/local/share/lua/5.1/bamboo/model.lua:1088: in function
> 'checkLogicRelation'
>  /usr/local/share/lua/5.1/bamboo/model.lua:1628: in function 'walkcheck'
> /usr/local/share/lua/5.1/bamboo/model.lua:1673: in function 'filter'
>  stdin:1: in main chunk
> [C]: ?
>
>


-- 
Nothing is impossible.