Hi!
There's a way to make Beaker work inside a view callable defined as a class? 
For example:

from beaker.cache import cache_region

@view_config(name="demo.html", renderer='epi:templates/mytemplate.pt')
class demoView(object):

    def  __init__(self,context,request):
        """
        """
        self.context = context
        self.request = request
    
    def __call__(self):
        page_title = self.getHello('Not cached')
        return dict(api = api, page_title=page_title)
    
    @cache_region('default_term', 'getHello')
    def getHello(self, param):
        print param
        return 'Hello'

It seems that Beaker uses the signature of the class as cache_key, so every 
time the class is instantiated, the key changes... I've noticed that Pylons 
uses a special decorator for this purpose 
(pylons.decorator.cache.beaker_cache)... is there any chance to make it work in 
Pyramid? or any alternative?

Thanks in advance!

VĂ­ctor.
UPC Plone Team - Barcelona
IRC/twitter: sneridagh

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-devel" group.
To post to this group, send email to pylons-devel@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-devel?hl=en.

Reply via email to