[ZPT] FORMs and processing

Evan Simpson evan@digicool.com
Tue, 26 Jun 2001 10:45:02 -0500


From: "Tony McDonald" <tony.mcdonald@ncl.ac.uk>
> <dtml-in do_an_sql_query_that_only_returns_one_row>
> <dtml-if submit>
>     do stuff with the data.
> </dtml-if>
>
> <form method="post">
> <input type="text" name="surname" value="<dtml-var surname missing>">

A literal translation of this would look like:

<div tal:repeat="row do_an_sql_query_that_only_returns_one_row">
<div tal:condition="exists:request/submit">
    do stuff with the data.
</div>
<form method="post">
<input type="text" name="surname" tal:attributes="value request/surname
| nothing">

...but the sql query and "do stuff" look like prime candidates for a
Script.

Cheers,

Evan @ digicool