No. and frankly I do not understand why it behaves it this way. You
are doing something I never thought of: caching a constructor instead
of a function. I will check this.

Massimo

On Mar 28, 5:33 am, David Zejda <d...@atlas.cz> wrote:
> Please, look at the trivial controller:
>
> class Blah:
>     def sessiontime(self):
>         return session.ctime
>
> def cache_test():
>     import time
>     session.ctime = time.ctime()
>     b = cache.ram('blah',Blah,50)
>     return dict(cached=b.sessiontime(), current=session.ctime)
>
> Because the time is not stored in the cached object, I would expect
> equal 'cached' and 'current' value on every run.
> But it seems that the session object is being stored together with
> Blah somehow, so the values differ, starting with the second run for
> the time for which the object is being held in cache:
>
> cached : Sun Mar 28 12:22:43 2010
> current : Sun Mar 28 12:23:10 2010
>
> Is this behaviour intentional? I would expect to get fresh session
> instead.
>
> Regards :)
> David

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

Reply via email to