[Zope] Re: DTML calling explained

Brad Clements bkc@murkworks.com
Wed, 2 May 2001 13:18:39 -0400


Thank for the detailed explanation.

Adding REQUEST solved my problem. I had also tried adding _ but that didn't work 
from pythonscript even though _ was bound to the dtml namespace.

(ie, I tried   context.ProductInfo(None,_,productid=traverse_path[0])

But I still think there is a problem.

pythonscript ProcessPath calls DTML Method ProductInfo which dtml-var DTML 
Method Standard_Html_Header.

In Standard_Html_header I have

<dtml-unless bgcolor>
do something
</dtml-unless>

My understanding of dtml-unless is that it's true if bgcolor is None, '' or does not exist in 
the namespace.

If ProcessPath includes REQUEST in it's call to ProductInfo, all is well. But if 
REQUEST is not included, then I get a KeyError on the <dtml-unless bgcolor> 
statement. 

This doesn't seem correct. I'd expect to not get a KeyError, since dtml-unless is 
supposed to catch that.  Isn't it?

So .. if a DTML_Method does not get REQUEST, looks like <dtml-unless> doesn't do 
what's expected.



Brad Clements,                bkc@murkworks.com   (315)268-1000
http://www.murkworks.com                          (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com               AOL-IM: BKClements