[Zope-DB] Problem wiith dtml-sqltest variable and multiples values into one parametert ???

Dieter Maurer dieter at handshake.de
Wed Nov 29 17:08:46 EST 2006


CERETTO Thierry wrote at 2006-11-29 09:15 +0100:
> ...
>Also, I test with "test" tab of "Z SQL method", it's the same, when I
>put "f1" in parameter field, that's work but if I put "f1,f2" (list)
>that's doesn't work (I get message above) (alos I tried : "f1","f2" and
>'f1','f2', etc, etc, but without success)

"multiple" expects to get a sequence of objects
but HTML/HTTP handles only strings.

Either, you must use Python means to convert the string "f1, f2, ..."
into a list of strings (e.g. "str.split(', ')"),
or use ZPublisher magic (in this concrete case, the ":list" variable
suffix) to let ZPublisher perform the type conversion.

In your special case, using separate "hidden" fields (one for
each list element, all sharing the same name) may be sufficient
(as the ":list" is (almost) the default for this case).

You find a concise description of ZPublisher's magic suffixes in

  <http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html>




-- 
Dieter


More information about the Zope-DB mailing list