[Zope-DB] Problem with <dtml-sqltest ... multiple> feature

Ken Winter ken at sunward.org
Wed Feb 13 21:00:01 EST 2008

This ZSQL method:

    organization_id, name, url_name, short_name
<dtml-sqlgroup where> 
    <dtml-and> <dtml-sqltest organization_id op="eq" type="int" multiple
    <dtml-and> <dtml-sqltest url_name op="eq" type="nb" multiple optional>
    <dtml-and> <dtml-sqltest name op="eq" type="nb" multiple optional>

doesn't work properly when I give it "a sequence of values to test the
condition against", which is what the "multiple" tag is supposed to allow
according to http://www.plope.com/Books/2_7Edition/AppendixA.stx#1-15 .
When I enter (for example) the string "HI, RF" (without the surrounding
quotes) into the url_name field on the ZSQL method's ZMI Test tab, it
returns no records and says that the SQL it generated was:

    organization_id, name, url_name, short_name
url_name = 'HI, RF'

If I enter a series of integers such as "11530, 11531" (again, minus the "s)
into the organization_id field, it returns the error message:

Invalid integer value for organization_id

Entering a single value into any of these fields works fine.  I have tried
various ways of quoting, delimiting, and otherwise punctuating my
multiple-value arguments, to no avail.

Is this problem just because the "multiple" feature doesn't work when tested
in the ZMI?  If so, can you tell me the correct way to type and format the
multiple-valued arguments when calling the ZSQL method from Python or from a
Page Template?

~ Ken

More information about the Zope-DB mailing list