[Zope] [Newbie] ZSQL problem

Michal Seta mis@creazone.com
Thu, 04 Jan 2001 01:45:35 -0500


Hello all.

I'm a total newbie to Zope (a few days).

I have a problem with getting some results throuh a ZSQL method.
(I've been playing with a sample baseball database that came with
PyGreSQL.)


I have a form that accepts multiple choice:  (generated by the wizard)

<form action="search_data_result" method="get">

<tr><th>Home team</th>
    <td><select name="home_team" size="10" multiple>
<option value="Indians">Indians</option>
<option value="Blue Jays">Blue Jays</option>
<option value="White Sox">White Sox</option>
<option value="Red Sox">Red Sox</option>

</select>
<input type="SUBMIT" name="SUBMIT" value="Submit Query">
</td></tr>
</table>
</form>
--------
My ZSQL method, called get_all_from_game is the following:

select * from game
where home_team=
<dtml-sqlvar home_team type=string>

and I have specified 1 argument: home_team
------
the output page: search_data_result looks like that:  (it's been
generated by the wizard)


<dtml-in get_all_from_game size=50 start=query_start>
   <dtml-if sequence-start>

      <dtml-if previous-sequence>

        <a href="<dtml-var URL><dtml-var sequence-query
                 >query_start=<dtml-var
                 previous-sequence-start-number>">
        (Previous <dtml-var previous-sequence-size> results)
        </a>

      </dtml-if previous-sequence>

      <table border>
        <tr>
          <th>Home team</th>
          <th>Visiting team</th>
          <th>Home team runs</th>
          <th>Visiting team runs</th>
          <th>Game date</th>
          <th>Game number</th>
        </tr>

   </dtml-if sequence-start>

        <tr>
          <td bgcolor="#A6A6A6"><dtml-var home_team null=""></td>
          <td><dtml-var visiting_team null=""></td>
          <td><dtml-var home_team_runs null=""></td>
          <td><dtml-var visiting_team_runs null=""></td>
          <td><dtml-var game_date null=""></td>
          <td><dtml-var game_number null=""></td>
        </tr>

   <dtml-if sequence-end>

      </table>
      <dtml-if next-sequence>

         <a href="<dtml-var URL><dtml-var sequence-query
            >query_start=<dtml-var
            next-sequence-start-number>">
         (Next <dtml-var next-sequence-size> results)
         </a>

      </dtml-if next-sequence>
   </dtml-if sequence-end>

<dtml-else>

  There was no data matching this <dtml-var title_or_id> query.

</dtml-in>

---

When I select one item in the list I get the results as specified in the
SQL query.  However, I get nothing when I select more than one item.
What am I doing wrong?

Thanks in advance.

MiS