<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV>I have a simple test Zope product inheriting from Cacheable, PropertyManager and SimpleItem.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Say&nbsp;I have a dtml method at <A href="http://myzopeinstance.com/testdtml"><FONT color=#0000ff>http://myzopeinstance.com/testdtml</FONT></A> with contents</DIV>
<DIV>&lt;dtml-let myvar="'hello world'"&gt;&lt;dtml-var testproduct&gt;&lt;/dtml-let&gt;</DIV>
<P>&nbsp;</P>
<P>I'd like "myvar" to be available in the__call__ method of testproduct.&nbsp; I don't know how to do that.</P>
<P>&nbsp;</P>
<P>Here's my testproduct&nbsp;__call__ method:</P>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; def __call__(self, client=None, REQUEST=None, **kw):<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foo="1. client:"+str(client)+"&lt;BR&gt;" \<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +"2. REQUEST:"+str(REQUEST)+"&lt;BR&gt;" \<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +"3. kw:"+str(kw)+"&lt;BR&gt;" \<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +"4. getattr(..REQUEST..):"+str(getattr(self, "REQUEST", None))+"&lt;BR&gt;" \<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +"5. getattr(..client..):"+str(getattr(self, "client", None))+"&lt;BR&gt;" \</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +"6. getattr(self, myvar...):"+str(getattr(self, "myvar", None))+ "&lt;BR&gt;" \</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +"7. aq_get(self, myvar...):"+str(aq_get(self, "myvar", None))+ "&lt;BR&gt;"</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return foo<BR></DIV>
<DIV>From poking around I was expecting "myvar" to be accessible somewhere from that list either directly or as an attribute of one of the objects, but it's not.&nbsp; Every call (via a web browser) displays None for every line except #4, the getattr(self, "REQUEST", None) statement.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Containment acquisition works more or less the way I would expect, i.e. if myvar is a dtml method in the same folder then&nbsp;the text "hello world"&nbsp;shows up on lines 6 and 7.&nbsp; (I don't understand though why the REQUEST object is always None;&nbsp; I thought when a DTML method calls another object the client and REQUEST parameters are passed in.)</DIV>
<DIV>&nbsp;</DIV>
<DIV>I'd appreciate it if someone can explain to me how things work and what I'm doing wrong.</DIV>
<DIV>&nbsp;</DIV></div><br>

      <hr size=1>Never miss a thing.  <a href="http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs"> Make Yahoo your homepage.</a>

</body></html>