[Zope] Still Chipping Away At Formulator/ZPT Interface

Dieter Maurer dieter@handshake.de
Tue, 5 Nov 2002 20:33:58 +0100


beno writes:
 > Okay, I *am* going to write a How-To on this when I get it all figured out 
 > with your help. This needs to be done.
 > In DTML, we do this to render the fields:
 > 
 > <dtml-in "form.get_fields()">
 > <dtml-let field=sequence-item>
 > <tr>
 > <td><dtml-var "field.get_value('title')"></td>
 > <td><dtml-var "field.render()"></td>
 > 
 > etc. How do I do this same thing in Python?
Python, usually, is not there to render a form.

In ZPT, it would be

   <tr tal:repeat="field here/form/get_fields">
     <td tal:content="python: field.get_value('title')" />
     <td tal:content="structure field/render" />
   </tr>

As you see, it's easier than in DTML.


Dieter