[Zope] class variable persistence question

Dieter Maurer dieter@handshake.de
Sat, 7 Dec 2002 21:21:05 +0100


AM writes:
 > I am writing a custom user folder. In the product I have a config.py 
 > file that has a number of parameters defined that are used all over the 
 > place by other classes. These parameters specify some global variables, 
 > that I would like to set when a new instance of the product is created.
 > 
 > If these parameters are preset then there is no problem at all, but that 
 > makes my product a bit inflexible. If I could set them when the product 
 > is instantiated, that would be great.
 > 
 > Can I set these parameters in the manage_add method and expect them to 
 > persist for the life of the instance??
When you put them in the instance, you can.

When you put them in the class, they are not persistent but live
only during the process' lifetime.

 > If not is there a work around for a situation like this??
I would read the configuration file during product import
and populate the class with the values read.


Dieter