[Twisted-Python] node with html content
stephen at thorne.id.au
Wed Sep 24 17:44:54 EDT 2003
suneetha at sonic.net wrote:
> request.d.createTextNode(data) creates a text node and display the data
>in the browser. I wanted to return a node in generate() method, that
>display a web form instead of displaying the text. I created the node
>with html content(string). Since I used createTextNode method, it is
>displaying the html source instead of form. Is there any other method
>that creates this kind of Node? If not how do I slove this?
Looking at twisted.web.woven.widgets.Text - if you want to return a node
that contains 'Raw' text (i.e. text that doesn't need to be escaped - as
in your case where you want to return form elements) you use
from twisted.web import domhelpers
textNode = domhelpers.RawText(data)
Does that answer your question.
I also highly recommend you have a good look at 'woven', and probably in
your case specifically 'lmx'.
More information about the Twisted-Python