[Zope-DB] sqltest multiple doesn't work...

Matthew T. Kromer matt@zope.com
Tue, 10 Sep 2002 10:29:40 -0400

Russell Hires wrote:

>Hash: SHA1
>Hey everyone,
>I've been playing with the sqltest tag, but I'm having trouble with multiple 
>values. The examples in the zope book aren't helping me, since I don't see 
>something that looks like what I need. I'm doing things for my class again, 
>and though it's possble to do the assignments in straight sql, it's not so 
>easy in dtml-sql. I've got a problem with compound criteria: this works in 
>select * from condo_tbl where (bedrooms = 2 and powder_room = true) or 
>bedrooms = 3;
>If I do this in dtml-sql:
>select unit_number, bedrooms, weekly_rate
>from condo_tbl 
>where <dtml-sqltest bedrooms type=int multiple> 
>I'm not able to put two values  in the test page field, and get a result. I 
>get an error:
>Error, exceptions.ValueError: Invalid integer value for bedrooms 
>SQL used:
>Could not render the query template!
>The integer I enter is either "2 3" or "2,3" or even "(2,3)" no quotes, of 
>Anybody got a solution?

I expect that the multiple option is expecting more than one input field 
by the same name, such that the publisher does the list conversion for 
you.  The test form is probably not capable of rendering  a pair of 
input fields of the same name.