passing a dtml-var to another method: dtml-let has no effect?
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
Panos Hilaris writes:
.... 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. ... You do not read documentation?
ZSQL Methods get their parameters either from REQUEST or (exclusive) from keyword parameters passed in. Suggested reading: the Zope Book or <http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html> Dieter
participants (2)
-
Dieter Maurer -
Panos Hilaris