I know this may be a simple question but how can I simply remove a variable from the request. regards garry
+-------[ 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@theinternet.com.au
--On Samstag, 5. Februar 2005 13:23 Uhr +0000 garry saddington <garry@scholarpack.org> wrote:
I know this may be a simple question but how can I simply remove a variable from the request.
Is there a good reason to remove something from the request? -aj
----- Original Message ----- From: "Andreas Jung" <lists@andreas-jung.com> To: <garry@scholarpack.org>; <zope@zope.org> Sent: Saturday, February 05, 2005 3:07 PM Subject: Re: [Zope] request variables
--On Samstag, 5. Februar 2005 13:23 Uhr +0000 garry saddington <garry@scholarpack.org> wrote:
I know this may be a simple question but how can I simply remove a variable from the request.
Is there a good reason to remove something from the request?
-aj
No there isn't, I've just realised that I should perhaps re-name the variables so the one in the request is not used in a ZSQL method but the correct one is. thanks garry
participants (3)
-
Andreas Jung -
Andrew Milton -
garry saddington