I have a simple test Zope product inheriting from Cacheable, PropertyManager 
and SimpleItem.

Say I have a dtml method at http://myzopeinstance.com/testdtml with contents
<dtml-let myvar="'hello world'"><dtml-var testproduct></dtml-let>

I'd like "myvar" to be available in the__call__ method of testproduct.  I don't 
know how to do that.

Here's my testproduct __call__ method:

    def __call__(self, client=None, REQUEST=None, **kw):
        foo="1. client:"+str(client)+"<BR>" \
           +"2. REQUEST:"+str(REQUEST)+"<BR>" \
           +"3. kw:"+str(kw)+"<BR>" \
           +"4. getattr(..REQUEST..):"+str(getattr(self, "REQUEST", 
None))+"<BR>" \
           +"5. getattr(..client..):"+str(getattr(self, "client", None))+"<BR>" 
           +"6. getattr(self, myvar...):"+str(getattr(self, "myvar", None))+ 
"<BR>" \
           +"7. aq_get(self, myvar...):"+str(aq_get(self, "myvar", None))+ 
        return foo

>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.

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.)

I'd appreciate it if someone can explain to me how things work and what I'm 
doing wrong.

Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  
Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to