[Zope] Re: Records Marshalling

stefano.ciccarelli@thewhitebird.com stefano.ciccarelli@thewhitebird.com
Wed, 28 Feb 2001 10:48:30 +0100


Thank you very much to all of you guys,

An example is worth one thousand words!!

I feel like am really learning something from these replies, expecially 
on the use of the (@#..rn) dtml-in tag.

I am gonna try.

Thanks agein, Stefano



----- Original Message -----
From: "Chris Withers" <chrisw@nipltd.com>
Date: Tuesday, February 27, 2001 8:09 pm
Subject: Records Marshalling

> > 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
> 
>