[Zope] how to build a search date range parameter in a search form

Gabriel Genellina gagenellina at softlab.com.ar
Mon Apr 3 23:03:19 EDT 2006


At Monday 3/4/2006 12:49, Lucia Colombo wrote:

><select name=" getAnno.query:record:list "
>                         id="getAnno"
>                         tabindex=""
>                         tal:attributes="tabindex tabindex/next;">
>              <tal:options repeat="year years_list">
>                            <option value="#" tal:define="start_date 
> python:DateTime(int(year), 1, 1);
> 
>end_date python:DateTime(int(year), 12, 31);
> 
>date_range python:[start_date, end_date];"
> 
>tal:attributes="value date_range" tal:content="year"> 2000 </option>
>              </tal:options>
></select>
>How do I get the parameter to be a list of dates?

You can't. :list joins multiple parameters into a single list, but an 
<option> gives just a single parameter.
But you don't need such things - you can compute start_date and 
end_date trivially (inside the form action) from the *only* integer 
parameter you need, the year.


Gabriel Genellina
Softlab SRL 



More information about the Zope mailing list