[Zope] Problem using dtml-in in ZSQL method
    Françoise CONIL 
    fcodvpt at gmail.com
       
    Thu Dec 11 05:21:28 EST 2008
    
    
  
*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>)
*Type de l'erreur*
NameError
 *Valeur de l'erreur*
'client' may not be used as an argument name in this context
This other code does not work better :
SELECT *
FROM MyTable
WHERE
  id in
    (<dtml-in mylist prefix="myid">
        <dtml-sqlvar expr="myid_item" type=int> <dtml-if
sequence-last><dtml-else>,</dtml-if>
    </dtml-in>)
*Same error*
However, if I use a dictionary list of this type [{'id':21},{'id':35}]  with
the following code, it works (but it's heavy)
SELECT *
FROM MyTable
WHERE
  id in
    (<dtml-in mylist mapping>
        <dtml-sqlvar id type=int> <dtml-if
sequence-last><dtml-else>,</dtml-if>
    </dtml-in>)
The python script that calls my ZSQL method has already build the integer
list and I would like to use it as is.
Thanks for your help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20081211/11aa71f0/attachment.html 
    
    
More information about the Zope
mailing list