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? --Ragnar
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?
--Ragnar
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Ragnar Beer wrote:
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?
My Very First External Method (TM) - def removeRequest(REQUEST, item): "Remove an item from a REQUEST.form" try: del REQUEST.form[item] except: pass return None And invoked (once instantiated by the Management Interface) with <dtml-call "removeRequest(REQUEST, 'form_variable')"> (Note that the except clause should really be trapping for KeyError - version 1.1 will definitely have this :-). Regards, Daryl Tester
participants (3)
-
Daryl Tester -
Loren Stafford -
Ragnar Beer