<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> </DIV>
<DIV>Say 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><dtml-let myvar="'hello world'"><dtml-var testproduct></dtml-let></DIV>
<P> </P>
<P>I'd like "myvar" to be available in the__call__ method of testproduct. I don't know how to do that.</P>
<P> </P>
<P>Here's my testproduct __call__ method:</P>
<DIV> </DIV>
<DIV> def __call__(self, client=None, REQUEST=None, **kw):<BR> foo="1. client:"+str(client)+"<BR>" \<BR> +"2. REQUEST:"+str(REQUEST)+"<BR>" \<BR> +"3. kw:"+str(kw)+"<BR>" \<BR> +"4. getattr(..REQUEST..):"+str(getattr(self, "REQUEST", None))+"<BR>" \<BR> +"5. getattr(..client..):"+str(getattr(self, "client", None))+"<BR>" \</DIV>
<DIV> +"6. getattr(self, myvar...):"+str(getattr(self, "myvar", None))+ "<BR>" \</DIV>
<DIV> +"7. aq_get(self, myvar...):"+str(aq_get(self, "myvar", None))+ "<BR>"</DIV>
<DIV> 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. Every call (via a web browser) displays None for every line except #4, the getattr(self, "REQUEST", None) statement.</DIV>
<DIV> </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 the text "hello world" shows up on lines 6 and 7. (I don't understand though why the REQUEST object is always None; I thought when a DTML method calls another object the client and REQUEST parameters are passed in.)</DIV>
<DIV> </DIV>
<DIV>I'd appreciate it if someone can explain to me how things work and what I'm doing wrong.</DIV>
<DIV> </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>