13 Apr
2004
13 Apr
'04
6:54 a.m.
On Tue, Apr 13, 2004 at 04:08:31PM +1000, Andy Gayton wrote:
def data_citiesList(self, context, data): return {"New York":'1', "Los Angeles":'2'}.items()
def render_city(self, context, data): return context.tag(value=data[1])[data[0]]
The only problem with the above is if you put something inside the option for the template, say:
<option nevow:pattern="item" nevow:render="city" value="1"> ned </option>
You will see ned prepended in each option rendered by nevow. Does anyone know how to overwrite the template contents of the option?
def render_city(self, context, data): return context.tag.clear()(value=data[1])[data[0]] .clear() returns self, so you can chain it like that. Stephen.