Works fine.

You can pass and use cache. You just cannot use it to decorate functions 
because decorators run only once, when the module is imported. Unless we make 
them lazy but I have not tried it yet...

On Jul 15, 2012, at 8:52 PM, Bruno Rocha wrote:

> So what happens when I do this?
> 
> 
> modules/mymodule.py
> 
> 
> from gluon import current
> 
> class MyHandler(object):
>     def __init__(self, db):
>         myrows = db(myquery).select(cache=(current.cache.ram, 300))
> 
> 
>         
> 
> 
> 
> ---------- Forwarded message ----------
> From: villas <[email protected]>
> Date: Sun, Jul 15, 2012 at 10:06 PM
> Subject: Re: [web2py] Re: how to use cache decorator within modules?
> To: [email protected]
> Cc: Massimo Di Pierro <[email protected]>
> 
> 
> Can we use cache decorators in modules now? 
> If not,  can I use cache in any way (inside a module)?
> 
> Thanks,  D
> 

Reply via email to