[Twisted-Python] read form parameter inside a rpy-script

Andrew Bennetts andrew-twisted at puzzling.org
Wed Jun 25 08:41:03 EDT 2003


On Wed, Jun 25, 2003 at 02:01:41PM +0200, mmoellenbeck at plus.de wrote:
>    Hi,
> 
>    I try to read form-parameter inside a rpy-script.
> 
>    Can anybody help me?

Resource scripts have been a rather active topic of discussion on the list the
past few days -- you really should check the archives.  You probably don't want
to be using them, as explained by Moshe Zadka in this post:

    http://twistedmatrix.com/pipermail/twisted-python/2003-June/004693.html 

Regarding form parameters, you'll find them in the .args attribute of a
request.  A trivial example would be:

    from twisted.web.resource import Resource
    from twisted.web.microdom import escape
    
    class RequestArgResource(Resource):
        def render(self, request):
            return 'request.args: ' + escape(repr(request.args))

-Andrew.





More information about the Twisted-Python mailing list