Can we use cache decorators in modules now?
If not, can I use cache in any way (inside a module)?
Thanks, D
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
: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
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
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
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
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.
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.
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)
9 matches
Mail list logo