[Zope] Problems accessing container properties at product creation time

Roy Mathew roymath at yahoo.com
Mon Apr 5 17:08:04 EDT 2004


Hi Folks,

I am trying to create a nested Zope product, and have trouble
accessing
properties from the container object...

 - I have a class MyFolder that extends Folder.
 - I have a class MyObj that extends (CatalogAware, SimpleItem,
PropertyManager)
 - Class MyFolder is meant to contain several instances of class
MyObj.

I am able to create instances of class MyObj properly, and even have
them be contained within MyFolder (using the inherited _setObject
method of MyFolder).

My problem is that I cannot seem to get manage_changeProperties to
work on instances of MyObj at the time of addition (ie: just after I
do the _setObject call). I have similar problems referencing
methods/properties of MyFolder from within the methods of MyObject at
the time of creation. However, after the addition has taken place, I
can then through the ZMI, access or manipulate those same (and
previously inaccessible/supposedly-non-existent) properties in
MyFolder from within MyObj instances.

What am I missing here. Is there anther step besides calling
_setObject that I need to do, when the container is also a custom
class in my product? Do I need to define my own __getattr__() for
MyObj instances? I have tried to grep through the source code for
various products, but am not seeing an obvious solution.

Thanks,
Roy Mathew.


__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/



More information about the Zope mailing list