[Zope] Records Marshalling
Chris Withers
chrisw@nipltd.com
Tue, 27 Feb 2001 19:09:04 -0000
> You could also use records marsalling to eliminate the redundant coding
> both on the form and map_add: (Not tested)
>
> <form action="map_add" method="post" enctype="multipart/form-data">
> <dtml-in expr="['Logo', 'Map']">
> <p><b><dtml-var sequence-item></b></p>
> <input type="hidden" name="images.id:records" value="<dtml-var
> expr="some expr">">
> <p>Title: <input type="text" name="images.title:records"> </p>
> <p>File: <input type="file" name="images.file:records"></p><br>
> </dtml-in>
> </form>
>
> Then map_add could be:
>
> <dtml-in images>
> <dtml-call expr="manage_addImage(id, file, title)">
> </dtml-in>
>
> or a python script:
>
> for img in context.REQUEST['images']:
> context.manage_addImage(img.id, img.file, img.title)
never saw that before... cool :-)
Chris