[Zope] Instance within Instance

Tim Cook twcook@iswt.com
Tue, 28 Nov 2000 23:18:17 -0600


Tim Cook wrote:
> 
> Next we get the newly constructed MyClass1, and setup to call the
> MyClass2 constructor:
> 
> <dtml-with "_.getitem('id')">
> 
>   <dtml-call expr="REQUEST.set('id', 'MyClass2ID')">
> 
>   <dtml-with "manage_addProduct['MyCoolProduct']">
>     <dtml-call expr="MyClass2_add(_.None, _, NoRedir=1)">
>   </dtml-with>
> 
> </dtml-with>
> 

There were some details I still left out here. This call to the
second constructor is in another DTML Method. The REQUEST values
are passed through using hidden form variables from the first
DTML Method.
Also in the second DTML MEthod you must be sure that you are
inside the parent folder context first.

<dtml-with "PARENTS[0]">
 <dtml-with "_.getitem('id')">
 
   <dtml-call expr="REQUEST.set('id', 'MyClass2ID')">
 
   <dtml-with "manage_addProduct['MyCoolProduct']">
     <dtml-call expr="MyClass2_add(_.None, _, NoRedir=1)">
   </dtml-with>
 
 </dtml-with>
</dtml-with>

Then you do a call to index_html or some appropriate Method so
the user isn't left with a blank display.

This will make sense to Daryl in the examples I sent. If anyone
else wants a better explaination maybe I'll do a formal HOW-TO
???


-- Tim Cook, President --
Free Practice Management,Inc. | http://FreePM.com
Office: (901) 884-4126
Censorship: The reaction of the ignorant to freedom.