[Zope] Please help with DTML-in (newbie)

Tino Wildenhain tino at wildenhain.de
Wed Dec 28 18:30:49 EST 2005


J Cameron Cooper schrieb:
> Alric Aneron wrote:
> 
>>  Hello, I am new to Zope and DTML.
>> I am trying to use a python script to call a Z SQL method.  The python
>> script also has a list that <dtml-in inside the ZSQL method interates
>> over. so my python script:
>> -----python script
>> words = ['one', 'two']
>> context.REQUEST.set('wordlist', wordlist)
>> rs = context.myzsqlmethod()
>> return rs[0,2]
>> -----z sql script:
>> SELECT * FROM table
>> WHERE
>> <dtml-in words>
>> column1 LIKE ('<dtml-var "'%'+sequence-item+'%'">' OR
>> column2 LIKE '<dtml-var "'%'+sequence-item+'%'">') <dtml-unless
>> sequence-end> AND </dtml-unless>
>> </dtml-in>

And dont use <dtml-var > in ZSQL Methods.
In your example, use <dtml-sqlvar sequence-item type=string> instead.
Even if you hardcode the wordlist, but even more if its coming
from request somewhere.


More information about the Zope mailing list