csog...@public.gmane.org wrote:
I would like to find out of a controller class instance is created
only once for each session, even though it's called multiple times.
Based on my tests it seems that my global data (self.myvar) disappears
every time its controller is referenced by a different controller of
the same login session.
Controllers will be created for each request. Assuming the the 'self' referred
to above is a controller then self.myvar will definitely disappear.
If you want to see a detailed analysis of what happens on a request then see
http://sluggo.scrapping.cc/python/pylons/pylons-execution.html
What I'm trying to do is cache some intensive SQL-generated data so it
doesn't fetch them every time the controller is called.
Pylons has specific support for that use case - see
http://pylonshq.com/docs/0.9.4.1/caching.html
Robert