[Zope] request variables

Andrew Milton akm at theinternet.com.au
Sat Feb 5 09:37:38 EST 2005


+-------[ garry saddington ]----------------------
| I know this may be a simple question but how can I simply remove a variable 
| from the request. 

You need to delete it from a python script, external method, or a product.

The request object has a few sub mappings you need to take care of, the main
two are 'form' and 'other'.

try:
    del request.form['blah']
except KeyError:
    pass

try:
    del request.other['blah']
except KeyError:
    pass

The other two are 'cookies' and 'environ' and you can delete them in a similar
manner to the above.


-- 
Andrew Milton
akm at theinternet.com.au


More information about the Zope mailing list