Re: [web2py] Re: how to use cache decorator within modules?

2012-07-15 Thread villas
Can we use cache decorators in modules now? If not, can I use cache in any way (inside a module)? Thanks, D

Re: [web2py] Re: how to use cache decorator within modules?

2012-07-15 Thread Bruno Rocha
15, 2012 at 10:06 PM Subject: Re: [web2py] Re: how to use cache decorator within modules? To: web2py@googlegroups.com Cc: Massimo Di Pierro massimo.dipie...@gmail.com Can we use cache decorators in modules now? If not, can I use cache in any way (inside a module)? Thanks, D

Re: [web2py] Re: how to use cache decorator within modules?

2012-07-15 Thread Massimo DiPierro
:06 PM Subject: Re: [web2py] Re: how to use cache decorator within modules? To: web2py@googlegroups.com Cc: Massimo Di Pierro massimo.dipie...@gmail.com Can we use cache decorators in modules now? If not, can I use cache in any way (inside a module)? Thanks, D

Re: [web2py] Re: how to use cache decorator within modules?

2011-03-01 Thread Carl Roach
thanks Massimo. The ability to have cache decorators in modules would be great. On 1 March 2011 02:09, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Jonathan and I have a plan to make this easy but it will not be in until 1.93 or 1.94. On Feb 28, 3:12 pm, pbreit pbreitenb...@gmail.com

[web2py] Re: how to use cache decorator within modules?

2011-02-28 Thread Ross Peoples
I've always read that if you needed to centralize your logic, that you should use modules instead of trying to do it in a model or trying to wire up one controller to another. I used global settings as an example, as you might need access to these settings in every controller, and duplicating

[web2py] Re: how to use cache decorator within modules?

2011-02-28 Thread Anthony
This is cool. I think your TimeClock example is essentially the pattern used for the web2py Mail, Auth, and Crud classes. It might be useful to include a section in the book about this pattern (or at least a web2py slice). Anthony On Monday, February 28, 2011 11:14:04 AM UTC-5, Ross Peoples

[web2py] Re: how to use cache decorator within modules?

2011-02-28 Thread pbreit
Yeah, I'm having a hard time figuring out when and how to put stuff in modules. And what the implications are of putting functions in /models.

[web2py] Re: how to use cache decorator within modules?

2011-02-28 Thread Massimo Di Pierro
Jonathan and I have a plan to make this easy but it will not be in until 1.93 or 1.94. On Feb 28, 3:12 pm, pbreit pbreitenb...@gmail.com wrote: Yeah, I'm having a hard time figuring out when and how to put stuff in modules. And what the implications are of putting functions in /models.

[web2py] Re: how to use cache decorator within modules?

2011-02-28 Thread kenji4569
What about this? (modules/mymodule.py) def main(environment): environment = Storage(environment) cache = environment.cache @cache('xxx', time_expire=1, cache_model=cache.ram) def xxx(): return 'xxx' return Storage(locals()) (in models or controllers)