from nevow import tags as T from nevow import rend, loaders class MyPage(rend.Page): docFactory = loaders.htmlstr(""" Nested Maps Sequence Rendering """) def __init__(self, dct): self.data_dct = dct rend.Page.__init__(self) def render_html(self, key): """ Render the given key as xml/html instead of escaping it as text. """ def _(ctx, data): if key in data: return ctx.tag[T.xml(data[key])] return "" return _ dct = [ {'name':'Mark', 'surname':'White', 'age':'45', 'description': '
Hello World
whatever
'}, {'name':'Valentino', 'surname':'Volonghi', 'age':'21'}, {'name':'Peter', 'surname':'Parker', 'age':'Unknown', 'description': '
Hello World
whatever
'} ] if __name__ == "__main__": print MyPage(dct).renderSynchronously()