[Twisted-Python] template in wchild

Donovan Preston dp at twistedmatrix.com
Fri Dec 12 10:43:18 EST 2003


On Dec 11, 2003, at 4:30 PM, vicky lupien wrote:

> I have a web base application with woven. I’m using an html template 
> with a form for my page.  In the setUp fonction I’ve changed my 
> template.
>
> So when I click on my submit button in my form, I want to see the 
> template with the modification from the setUp in my wchild_submit.  I 
> don’t know if it’s possible.  I tried to use request.d but it’s seems 
> that it’s not the same request from my page’s class.

Please use twisted-web for questions like this in the future -- it's 
what we set it up for. 
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web

twisted.web.woven.page.Page loads the template and parses it into a DOM 
at initialization time. If you want to dynamically construct a template 
in wchild_submit, which needs to return a Resource instance (which Page 
is), you should construct and return a new page instance with your 
dynamic template:

def wchild_submit(self, request):
	return page.Page(template="""<html>HELLO!</html>""")

dp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 1184 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20031212/966b3d89/attachment.bin 


More information about the Twisted-Python mailing list