[prev in list] [next in list] [prev in thread] [next in thread] 

List:       zope
Subject:    Re: [Zope] Please help with DTML-in (newbie)
From:       Alric Aneron <aluminum3458 () yahoo ! com>
Date:       2005-12-29 15:01:56
Message-ID: 20051229150156.77289.qmail () web50211 ! mail ! yahoo ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


thanks you all!! This helped a lot!

Tino Wildenhain <tino@wildenhain.de> wrote: 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 

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

>> column1 LIKE ('
' OR
>> column2 LIKE '
') 

>> sequence-end> AND 
>> 

And dont use 
 in ZSQL Methods.
In your example, use 
 instead.
Even if you hardcode the wordlist, but even more if its coming
from request somewhere.



		
---------------------------------
Yahoo! Photos
 Ring in the New Year with Photo Calendars. Add photos, events, holidays, whatever.
[Attachment #5 (text/html)]

<div id="RTEContent">thanks you all!! This helped a lot!<br><br><b><i>Tino Wildenhain \
&lt;tino@wildenhain.de&gt;</i></b> wrote:<blockquote class="replbq" \
style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: \
5px;"> J Cameron Cooper schrieb:<br>&gt; Alric Aneron wrote:<br>&gt; <br>&gt;&gt;  \
Hello, I am new to Zope and DTML.<br>&gt;&gt; I am trying to use a python script to \
call a Z SQL method.  The python<br>&gt;&gt; script also has a list that <dtml-in \
inside="" the="" zsql="" method="" interates=""><br>&gt;&gt; over. so my python \
script:<br>&gt;&gt; -----python script<br>&gt;&gt; words = ['one', 'two']<br>&gt;&gt; \
context.REQUEST.set('wordlist', wordlist)<br>&gt;&gt; rs = \
context.myzsqlmethod()<br>&gt;&gt; return rs[0,2]<br>&gt;&gt; -----z sql \
script:<br>&gt;&gt; SELECT * FROM table<br>&gt;&gt; WHERE<br>&gt;&gt; <dtml-in \
words=""><br>&gt;&gt; column1 LIKE ('<dtml-var ="" '%'+sequence-item="">' \
OR<br>&gt;&gt; column2 LIKE '<dtml-var =""  '%'+sequence-item="">') <dtml-unless \
=""><br>&gt;&gt; sequence-end&gt; AND </dtml-unless><br>&gt;&gt; \
</dtml-var><br><br>And dont use <dtml-var> in ZSQL Methods.<br>In your example, use \
<dtml-sqlvar sequence-item="" type="string"> instead.<br>Even if you hardcode the \
wordlist, but even more if its coming<br>from request \
somewhere.<br></dtml-sqlvar></dtml-var></dtml-var></dtml-in></dtml-in></blockquote><br></div><p>
  <hr size=1>Yahoo! Photos<br> 
Ring in the New Year with <a \
href="http://us.rd.yahoo.com/mail_us/taglines/photos/*http://pg.photos.yahoo.com/ph//page?.file=calendar_splash.html&.dir=">Photo \
Calendars</a>. Add photos, events, holidays, whatever.



_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic