I just check gluon/dal.py and if it is the count() code location it's not
have cache argument... Also I notice that there seems to have many
differents implementations of count... I wouder why it could not be a
generic function reused everywhere, it would be more DRY...

Richard

On Thu, Feb 9, 2012 at 12:48 PM, Anthony <abasta...@gmail.com> wrote:

> I don't think a count can be cached that way, but since it just returns a
> number, it can be cached in the usual way instead:
>
> count = cache.ram('count', lambda: db(query).count(), time_expire=60)
>
> Anthony
>
>
> On Thursday, February 9, 2012 12:42:02 PM UTC-5, Richard wrote:
>>
>> Is it just me ?
>>
>> db(query).count(cache=(cache.**ram, 60))
>>
>> Won't work...
>>
>> I get :
>>
>> TypeError: count() got an unexpected keyword argument 'cache'
>>
>> Richard
>>
>

Reply via email to