Currently, all my init stuff in __init__ are assignments to self.* variables. I am making those global variables for now so that they are inited just once. Does this hack have any obvious problems?
-T On Jun 30, 8:29 am, Branko Vukelic <[email protected]> wrote: > On Wed, Jun 30, 2010 at 2:17 PM, Mark Erbaugh <[email protected]> wrote: > > The reason that __init__ is called multiple times is that at least > > conceptually, a new instance of your Python script is run for each web page > > retrieved. IOW, when the web server receives a request for a > > So, it would be the simplest way to save the state of whatever you've > done in __init__ as a session variable, and run the expensivo stuff > only when the saved state indicates you need to. > > -- > Branko Vukelić > > [email protected] > [email protected] > > Check out my blog:http://www.brankovukelic.com/ > Check out my portfolio:http://www.flickr.com/photos/foxbunny/ > Registered Linux user #438078 (http://counter.li.org/) > I hang out on identi.ca:http://identi.ca/foxbunny > > Gimp Brushmakers Guildhttp://bit.ly/gbg-group -- You received this message because you are subscribed to the Google Groups "web.py" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/webpy?hl=en.
