[Twisted-Python] Some Question about on woven and rpy/page.Page
Hello, I have setup a simple web-server (see the files attached). When I comment out the render-method of MyPage (start.rpy), I get this output: <snip> Some stuff goes here- this is the 'submit not in request.args' Some more stuff goes here. this is the None </snip> It seems the request parameter 'submit' are not set. If I comment in the render-method of MyPage, I get this output: <snip> send via submit <snip> When I have a look to the request, it seems that the first request (with the correct parameter, return with 302) and then a second request will be done with 200. Have anybody an answer for me ;-) Martin
(Snip Martin having a problem with arguments not being in the request) Change: <form action="start.rpy"> To: <form action="start.rpy/"> Woven automatically adds a slash to the end of urls which are rendered by Page instances. This is to make writing relative links easier, by ensuring consistent behavior. It does this by performing a redirect, which loses the request arguments, because it causes the browser to perform another request. If you don't like this, and would prefer your urls to remain trailing-slashless, add the following attribute to your Page subclass: class MyPage(page.Page): addSlash = False Hope that helps. dp
Hi Donovan, this was the right answer, it's the way. Thanks a lot. Martin -----Ursprüngliche Nachricht----- Von: twisted-python-admin@twistedmatrix.com [mailto:twisted-python-admin@twistedmatrix.com] Im Auftrag von Donovan Preston Gesendet: Samstag, 28. Juni 2003 05:13 An: twisted-python@twistedmatrix.com Betreff: Re: [Twisted-Python] Some Question about on woven and rpy/page.Page (Snip Martin having a problem with arguments not being in the request) Change: <form action="start.rpy"> To: <form action="start.rpy/"> Woven automatically adds a slash to the end of urls which are rendered by Page instances. This is to make writing relative links easier, by ensuring consistent behavior. It does this by performing a redirect, which loses the request arguments, because it causes the browser to perform another request. If you don't like this, and would prefer your urls to remain trailing-slashless, add the following attribute to your Page subclass: class MyPage(page.Page): addSlash = False Hope that helps. dp _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
participants (2)
-
Donovan Preston
-
Martin.Moellenbeck@t-online.de