[Zope] Problem using dtml-in in ZSQL method

Andrew Milton akm at theinternet.com.au
Thu Dec 11 12:48:18 EST 2008


+-------[ Andrew Milton ]----------------------
| | ----- Original Message ----- 
| | From: Fran?oise CONIL
| | To: zope at zope.org
| | Sent: Thursday, December 11, 2008 11:21 AM
| | Subject: [Zope] Problem using dtml-in in ZSQL method
| | 
| | 
| | Hello,
| | 
| | My ZSQL method receive a *mylist* parameter that should be an integer list :
| | [21,35]
| | 
| | The following code does not work :
| | 
| | SELECT *
| | FROM MyTable
| | WHERE
| |   id in
| |     (<dtml-in mylist>
| |         <dtml-sqlvar sequence-item type=int> <dtml-if
| | sequence-last><dtml-else>,</dtml-if>
| |     </dtml-in>)
| 
| select * from mytable
| <dtml-sqlgroup where>
| <dtml-sqltest mylist multiple type=int>
| </dtml-sqlgroup>

Actually the sqlgroup is superfluous in this case;

name your "mylist" parameter as "id" 
and
select * from mytable <sqltest id multiple type=int>

or if you don't want to rename your parameter

select * from mytable <sqltest mylist multiple type=int column=id>

should work fine

-- 
Andrew Milton
akm at theinternet.com.au


More information about the Zope mailing list