lazy_cache docstring

This commit is contained in:
mdipierro
2012-07-25 16:57:17 -05:00
parent ba80c083ab
commit f0237e4ec8
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.00.0 (2012-07-25 16:53:17) dev
Version 2.00.0 (2012-07-25 16:57:13) dev
+7
View File
@@ -479,6 +479,13 @@ class Cache(object):
return tmp
def lazy_cache(key=None,time_expire=None,cache_model='ram'):
"""
can be used to cache any function including in modules,
as long as the cached function is only called within a web2py request
if a key is not provided, one is generated from the function name
the time_expire defaults to None (no cache expiration)
if cache_model is "ram" then the model is current.cache.ram, etc.
"""
def decorator(f,key=key,time_expire=time_expire,cache_model=cache_model):
key = key or repr(f)
def g(*c,**d):