[Zope] inheritance and aqusition question
Andrew Milton
akm at theinternet.com.au
Fri Feb 3 07:00:10 EST 2006
+-------[ Roman Klesel ]----------------------
|
| Hello,
|
| im just learning zope and python and find it difficult to get the details of aquisition and inheritance.
| I have the following problem:
|
| (FS product)
|
| My base class has an attribute manage_editSettingsForm
| In its __init__ method I instantiate a contoller class.
| In the methods of the controller class can access self.manage_edtiSettingsForm (fine)
| Now I instantiate a importSingle class in a method of the controller class.
| In the methods of the importSingle class I cannot access self.manage_edtiSettingsForm (why?)
One (or more) of the following two;
Your class isn't yet fully instantiated and Acquisition wrapped, this normally
doesn't occur until your class is inside the ZODB. You generally need to use a
'post init' method to do a 2-stage init so that subitems can acquire items.
There are Zope hooks you can use (manage_afterAdd), or you can call your
own methods in the "manage_add" Factory method of your product.
If this is what you are doing then it's probably;
The importSingle class must be an attribute of the Controller class for
Acquisition to work in this way.
--
Andrew Milton
akm at theinternet.com.au
More information about the Zope
mailing list