Hi,

I tried the Wichert's configuration and declared my view --

@cache.cache_region('long_term')
def home_view(request):

but got an error --

File '/home/virtualenv/lib/python2.6/site-packages/Beaker-1.5.4-
py2.6.egg/beaker/cache.py', line 114 in cached
  return cache[0].get_value(cache_key, createfunc=go)
File '/home/virtualenv/lib/python2.6/site-packages/Beaker-1.5.4-
py2.6.egg/beaker/cache.py', line 214 in get
  return self._get_value(key, **kw).get_value()
File '/home/virtualenv/lib/python2.6/site-packages/Beaker-1.5.4-
py2.6.egg/beaker/container.py', line 298 in get_value
  v = self.createfunc()
File '/home/virtualenv/lib/python2.6/site-packages/Beaker-1.5.4-
py2.6.egg/beaker/cache.py', line 112 in go
  return func(*args)
TypeError: home_view() takes exactly 1 argument (2 given)

The unwanted argument is in fact a traversal context object --

>>> args
(<pyramid.traversal.DefaultRootFactory instance at 0xaa67e2c>,
<Request at 0xaa67e0c GET http://localhost:6543/>)

How does beaker cache work with Pyramid?

Thanks.

Jerry

On Dec 12, 2:49 am, Daniel Holth <dho...@gmail.com> wrote:
> Massimiliano,
>
> I went down the same path of looking for a per-request caching middleware
> that worked in the same way as the session middleware. Eventually I decided
> caching was not tied to a single request in the same way as a session, so I
> have a global cache as Wichert suggests.
>
> Daniel

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-devel" group.
To post to this group, send email to pylons-de...@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