> > I want to generate HTML output like this: > > Let's get one thing clear please: Widget's are NOT (only) HTML markup > generators. They do generate markup but their main reason to-be (IMO) > is to nicely pack and reuse common view elements and their resources > (AutoCompleteField, CalendarDatePicker, TinyMCE, etc...) and to > validate and coerce into python objects the input received from the web.
I didn't know that. But in that case maybe TurboGears need a better way to create reusable html markup generators? > > item1..itemX are either plain text strings or they are contained > > widgets. It is trivial to manually generate text like this, but I want > > to do it the idiomatic, widgets-way. My requirement for the solution > > is that it must not be much more complex than this: > > > > def list_items_to_html(items): > > return "<p>" + "<br/>".join(render(item) for item in items) + > > "</p>" > > This seems like a task best suited for proper (X)HTML generators like > elementtree, markup, stan, kid etc... IMO. Using widgets to do this > would probably be overkill (unless each <p> needs some special > javascript source files included, for example) I suppose it is overkill. The reason I need it is because I need to embed the above html inside a TableForm. The TableForm takes a list of fields as its parameter and all of the fields need to be widgets. -- mvh Björn --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears -~----------~----~----~----~------~----~------~--~---

