[Zope] Retrieving ans processing multiple list selections

Sabine Ritter Sabine_Ritter@t-online.de
Mon, 25 Jun 2001 22:01:11 +0200


Hi there,

I am using a form with several drop-down lists which allow multiple =
options
to be selected.
example:
    <select name=3D"country"  size=3D"8" multiple>
     <option selected value=3D"">entire Europe
     <option value=3D"1">France
     <option value=3D"2">Germany
     .....................
     <option value=3D"15">Denmark
     <option value=3D"16">Spain
    </select>

The selections are used in an ZSQL-Method:

SELECT x, y, COUNT(lfdnr) AS Anzahl
FROM table
<dtml-sqlgroup where>
  <dtml-sqltest country type=3Dint multiple optional>
<dtml-and>
....................
</dtml-sqlgroup>=20
GROUP BY x, y, z

The result of the ZSQL-Method is shown on a report page with
<dtml-in ZSQL-Method size=3D50 start=3Dquery_start>
......................

Before displaying the result of the query I would like to summarize the
selection like:
"You have selected:
country: France and Denmark
age-group: 10-14 years and 15-19 years
-----
Here is the result of your query:
<table>

As long as only one option is selected is can use
<dtml-if expr=3D"country=3D=3D'1'">
  France
<dtml-elif expr=3D"country=3D=3D'2'">
  Germany
.................... =20

However, if multiple options are selected, <dtml-var bl> will return a =
list of values
like ['3','4','6'] and the above 'translation' doesn't work any more.

Q u e s t i o n:
How can I process ('translate') the list-values?
Is there a way to directly adress the option text???

Thanks for supporting a real Newbie
      =20
   Sabine

One more question: can anybody tell me, where I can get more information
about all this "" , '  ', ['  '], _.[    ()] stuff ? (meaning and proper =
use of it)