[Zope] Re: METAL question

Dieter Maurer dieter at handshake.de
Fri Sep 26 14:13:18 EDT 2003


Andreas Tille wrote at 2003-9-26 14:33 +0200:
 > On Thu, 25 Sep 2003, Dieter Maurer wrote:
 > ...
 > > <tal:attributes define="item  string:item_a">
 > >   <metal:macro define-macro="ItemControl">
 > >     <th tal:define="FormItem form/?item">
 > >       <span tal:replace="structure python:FormItem.get_value('title')">Item</span>
 > >     </th>
 > >     <td tal:define="ItemValue request/?item | nothing"
 >                                                         >
 > >       <input tal:replace="structure python:FormItem.render(ItemValue)">
 > >     </td>
 > >   </metal:macro>
 > > </tal:attributes>
 > ...
 >   Module Python expression "FormItem.render(ItemValue)", line 2, in f
 > NameError: global name 'FormItem' is not defined

Move the "FormItem" definition up from the "th" element to the "metal:macro"
element such that it covers both the "th" and "td" elements.


Dieter



More information about the Zope mailing list