Problem wiith dtml-sqltest variable and multiples values into one parametert ???

"CERETTO Thierry" <[email protected]>
Newsgroups gmane.comp.web.zope.database
Message-ID <[email protected]>
Hi,

 

(Zope 2.8.6-final, python 2.3.5, win32, ZMySQLDA 2.0.8) 

 

I have created a "Z Search Interface" to select some data from MySql
table.

 

In "search form" (Page Template), I have created a select field (called
"select_keys") to select one or more keys words (from MySQl table). On
submit, with javascript, I fill an hidden field called "ref_fiche" where
I put a list (JS array) of value select in field "select_keys", for
example, value can be : f1 or f1,f4,f2, etc

 

"Search form" use "result_form" which use a "Z SQL Method" where the SQL
is write like this : SELECT titre, descriptif, gestionnaire, coord_gest,
URL  FROM reference_fiche WHERE (<dtml-sqltest ref_Fiche type="string"
multiple>) This Z SQL Method had one parameter called "ref_fiche".

 

Well, from search form, when I select one key word, all works fine: one
result is found and display, but when I select several keys words, SQL
doesn't works, I get this Zope  message :

 

**********************

SQL used:

SELECT titre, descriptif, gestionnaire, coord_gest, URL  FROM
reference_fiche WHERE (ref_Fiche = 'f1, f4')

 

**********************

 

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)

 

Zope documentation says about dtml-sqltest variable and multiple
argument;
http://zope.org/Documentation/Books/ZopeBook/2_6Edition/RelationalDataba
ses.stx
<http://zope.org/Documentation/Books/ZopeBook/2_6Edition/RelationalDatab
ases.stx> 

 

**********************

multiple

    A flag indicating whether multiple values may be provided. This lets
you test if a column is in a set of variables. For example when name is
a list of strings "Bob" , "Billy" , <dtml-sqltest name type="string"
multiple> renders to this SQL: name in ("Bob", "Billy").

**********************

 

but, in Zope message above, the SQL used which I see "(ref_Fiche = 'f1,
f4')" and not "ref_Fiche IN ('f1','f4') Why ?

 

It's a bug ?

 

How pass one list parameter ?   

 

Any clues (solutions) are welcome,

 

Thank you,

 

Thierry

_______________________________________________
Zope-DB mailing list
[email protected]
http://mail.zope.org/mailman/listinfo/zope-db
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.