gluon.cache on functions with arguments

13 views
Skip to first unread message

PhE

unread,
Jul 7, 2011, 7:08:21 AM7/7/11
to web2py-users
Hello,

I'm trying to use gluon.cache and @cache decorator in my web2py
application.
It works fine for decorating controller methods.

Now, I would like to use web2py cache in my modules :

@cache('fct1_key', time_expire=5, cache_model=cache.ram)
def my_function1(a, b, c):
#...
return 'something'

I look inside gluon/cache.py but the caching code seems to not allow
functions with arguments :-/
How to use argument with @cache decorator ?

How to make the cache aware of arguments values ?
It could be usefull to have web2py cache with a "pure function cache"
behaviour for the models/modules layer.
Reply all
Reply to author
Forward
0 new messages