Re: ZSQL + MySQL + sqltest + list

Charlie Clark <[email protected]>
Newsgroups gmane.comp.web.zope.database
Message-ID <[email protected]>
On 2006-04-05 at 10:39:11 [+0200], Matthew Fairclough 
<[email protected]> wrote:
> Chris,
> 
> Thanks for your help.
> 
> Basically I just want to limit the result to a number of entries based on 
> Id.
> 
> As there are several Id's I'm trying for "... where catId IN (x, y, z)".
> 
> I could just use a variable that is a list (through REQUEST) but I would 
> like to
> ensure the argument is an integer, hence sqltest.

This is one of the reasons why I'm no great fan of <dtml-sqltest>.

You can easily do your checking for an integer in a PythonScript and pass 
the result into your ZSQL as a standard DTML variable.

catID = [int(i) for i in catIDs]

Cleaner and quicker than playing the <dtml-sqltest>.

Charlie
-- 
Charlie Clark
eGenix.com

Professional Python Services directly from the Source
 >>> Python/Zope Consulting and Support ...        http://www.egenix.com/
 >>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________
2005-10-17: Released mxODBC.Zope.DA 1.0.9        http://zope.egenix.com/

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.