[Zope-dev] creating one ZClass instance in the constructor of another

Brian Hooper brian@garage.co.jp
Thu, 22 Jul 1999 18:47:52 +0900


Hi Zopistas -

This is probably a really easy one, but I was wondering if anyone knows
how to create an instance of one ZClass inside the constructor of a
different ZClass.  To illustrate with an example:

I have defined two ZClasses, a ProjectManager and a GuestBook (I
reimplemented the old Guestbook example product using ZClasses) as
separate Products (since they are not really intrinsically related).
I want to use the GuestBook in the ProjectManager, but I can't figure
out how to create the GuestBook in the ProjectManager's constructor.

I want to do something like

<!--#call "GuestBook_add(id)"-->

in the ProjectManager_add method; however, since the other Product's
names don't seem to be defined in the namespace of ProjectManager_add,
this doesn't work.

Can anyone please tell me the magical solution to this problem?


--Brian Hooper
Digital Garage, Inc.