[Zope] delete from REQUEST?

Tres Seaver tseaver@palladion.com
Tue, 21 Mar 2000 14:54:11 -0600


"Loren Stafford" <lstaffor@dynalogic.com> wrote:
> 
> The REQUEST object is defined in ../lib/python/ZPublisher/BaseRequest.py. I
> don't see a delete there, but by studying that code, I'm sure you could
> easily implement one.
> 
> -- Loren
> 
> ----- Original Message -----
> From: Ragnar Beer <rbeer@uni-goettingen.de>
> To: <zope@zope.org>
> Sent: March 21, 2000 09:47 AM
> Subject: [Zope] delete from REQUEST?
> 
> > Hi Zopistas!
> >
> > I need to get rid (completely) of some items in REQUEST that were
> > passed from a form. Is there an opposite to REQUEST.set() that
> > deletes instead e.g. REQUEST.delete() or so?

The REQUEST object stores form data in its .form member, which is a Python
dictionary.  You will need to find a way to execute the statement, "del
REQUEST.form[ 'variableToErase' ]", or the equivalent expression, "delattr(
REQUEST.form, 'variableToErase' )", neither of which can be done from DTML or
from PythonMethods (ergo, must be done in an ExternalMethod or done from a
Python product).

-- 
=========================================================
Tres Seaver         tseaver@palladion.com    713-523-6582
Palladion Software  http://www.palladion.com