REQUEST.unset('property') in DTML ?
Hi all, I was read in archives about REQUEST.unset to unset property. But published patch is little older (1999) and my Zope 2.5.1 is totally different than that patch. Zope does not protest when I save DTML method with REQUEST.unset('property'), but when I access page, then Zope give me error that unknown keyword unset. Note that pythonic :) equivalent to unset <dtml-call "del REQUEST.other['property']"> could not be saved to server (error). It is possible to delete previously <dtml-call "REQUEST.set('property')"> in DTML ? Thanks a lot, J. Lukesh
Jaroslav Lukesh wrote at 2003-9-2 13:17 +0200:
I was read in archives about REQUEST.unset to unset property. But published patch is little older (1999) and my Zope 2.5.1 is totally different than that patch.
Zope does not protest when I save DTML method with REQUEST.unset('property'), but when I access page, then Zope give me error that unknown keyword unset.
In DTML, a non existing variable is often treated similar to one with a false value. Thus, you may partially emulate "unset(XXX)" with "set(XXX,None)". If this is not an option, you can try "del REQUEST.other(XXX)" in a Python Script. If this results in an "Unauthorized" exception, you must do it in an External Method. Try to avoid tampering with REQUEST. Dieter
participants (2)
-
Dieter Maurer -
Jaroslav Lukesh