[Zope-DB] multiple table updates

Charlie Clark charlie@begeistert.org
Thu, 20 Mar 2003 10:41:20 +0100


On 2003-03-19 at 18:53:18 [+0100], garry saddington wrote:
> I have a form which retrieves data from a database table and displays it 
> for the user to amend. Many records are able to be changed and i would 
> then like to be able to update all these records in the table. I can not 
> find a way to do this as yet. Can anyone help?
> regards
> garry saddington

Sure,

you need to have an ID per row in the table which you can use as an index 
on the lists to call SQL repeatedly.

ie.
<tr tal:repeat="result results">
<td><input type="hidden" name="counter" tal:attributes="value 
result/number"></td>
<td> ... </td>
</tr>

Alternatively you might generate compound names or values with IDs. It 
depends a bit on the database structure.

Hope that helps

Charlie