[Zope-DB] ZSQL + MySQL + sqltest + list

Charlie Clark charlie at egenix.com
Wed Apr 5 05:07:48 EDT 2006

On 2006-04-05 at 10:39:11 [+0200], Matthew Fairclough 
<faircloughm at easp.com.au> 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 Clark

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

More information about the Zope-DB mailing list