Re: Can't get multiple to work in dtml-sqltest
Mark Phillips <[email protected]> Sat, 2 Oct 2010 08:46:32 -0700
| Newsgroups | gmane.comp.web.zope.database |
|---|---|
| Message-ID | <[email protected]> |
--===============1550419068726153529== Content-Type: multipart/alternative; boundary=0016364d320723b7b70491a437a5 --0016364d320723b7b70491a437a5 Content-Type: text/plain; charset=ISO-8859-1 Never mind.....cockpit error.....I looked a the sql generated from the queries and it was correct in all cases. The problem lay elsewhere in my Python script. Multiple works as advertised! BTW, I also read in some posts that the type parameter does not work. But according to my mysql logs, the type parameter does work as advertised. The only issue is one cannot enter a list of values from the ZMI to test the sql. You have to do it from a Python script. Mark On Fri, Oct 1, 2010 at 6:32 PM, Mark Phillips <[email protected]>wrote: > I have a ZSQL query getPlayersBySeasons with one input value, seasonID: > > select distinct player.playerID, firstName, lastName, number, birthdate, > positions, bats, throws, active > from player, SeasonPlayer > <dtml-sqlgroup required where> > <dtml-sqltest seasonID column=SeasonPlayer.seasonID type=int optional > multiple> > <dtml-and> > SeasonPlayer.playerID=player.playerID > </dtml-sqlgroup> > > and my python code: > players = context.getPlayersBySeasons(seasonID=s).dictionaries() > > If s = [1], or s=[2], or s=[1,2] or s="", I get the same result set back. > > What is the correct syntax for using the multiple key word? I have googled > and it seems that a lot of people have problems, and no one has a solution. > > Thanks! > > Mark > --0016364d320723b7b70491a437a5 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Never mind.....cockpit error.....I looked a the sql generated from the quer= ies and it was correct in all cases. The problem lay elsewhere in my Python= script. Multiple works as advertised! <br><br>BTW, I also read in some pos= ts that the type parameter does not work. But according to my mysql logs, t= he type parameter does work as advertised. The only issue is one cannot ent= er a list of values from the ZMI to test the sql. You have to do it from a = Python script.<br> <br>Mark<br><br><div class=3D"gmail_quote">On Fri, Oct 1, 2010 at 6:32 PM, = Mark Phillips <span dir=3D"ltr"><<a href=3D"mailto:mark@phillipsmarketin= g.biz">[email protected]</a>></span> wrote:<br><blockquote clas= s=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, 204, 204); margi= n: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> I have a ZSQL query getPlayersBySeasons with one input value, seasonID:<br>= <br>select distinct player.playerID, firstName, lastName, number, birthdate= , positions, bats, throws, active<br>from player, SeasonPlayer<br><dtml-= sqlgroup required where><br> =A0=A0=A0 <dtml-sqltest seasonID column=3DSeasonPlayer.seasonID type=3Di= nt optional multiple> <br>=A0=A0=A0 <dtml-and><br>=A0=A0=A0 Season= Player.playerID=3Dplayer.playerID<br></dtml-sqlgroup><br><br>and my p= ython code:<br>players =3D context.getPlayersBySeasons(seasonID=3Ds).dictio= naries()<br> <br>If s =3D [1], or s=3D[2], or s=3D[1,2] or s=3D"", I get the s= ame result set back.<br><br>What is the correct syntax for using the multip= le key word? I have googled and it seems that a lot of people have problems= , and no one has a solution.<br> <br>Thanks!<br><font color=3D"#888888"><br>Mark<br> </font></blockquote></div><br> --0016364d320723b7b70491a437a5-- --===============1550419068726153529== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Zope-DB mailing list [email protected] https://mail.zope.org/mailman/listinfo/zope-db --===============1550419068726153529==--