[Zope] passing a dtml-var to another method: dtml-let has no effect?

Panos Hilaris philaris@yahoo.com
Mon, 04 Feb 2002 18:14:18 +0200


   Thank you all for your answers concerning ``forms: copying ...'' 
message !

   Using the following in a document:

<dtml-let x="'foo'">
  <dtml-var x>
</dtml-let>

I get the expected "foo" in my document.


   However, if I try:

<dtml-let x="'foo'">
  <dtml-call sqlDistinct>
</dtml-let>

where sqlDistinct is a ZSQL Method having an argument with the name x, 
 I get a KeyError.  I have also tried to have the variable x defined 
from the start of my document, say with the value "bar".  In this case, 
with the above portion of code, I get no error, but sqlDistinct uses the 
value "bar" for x and not "foo".

   In fact, I want to set the variable x many times in a document and 
call for each value of x the sqlDistinct query, so I need to change the 
x variable in my document.  What should I do?


With friendly salutations,
Panos Hilaris