ormcache_context

This cache works similarly to ormcache, except that it depends on the parameters plus the value in the context. In this cache's decorator, you need to pass the parameter name and a list of context keys. For example, if your method's output depends on the lang and website_id keys in the context, you can use ormcache_context:

@tools.ormcache_context('mode', keys=('website_id','lang'))
def fetch_data(self, mode):
# some calculations
return result

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset