[Zope-dev] __after_publishing_traverse__

Casey Duncan casey@zope.com
Mon, 15 Apr 2002 12:57:09 -0600


Ivo van der Wijk wrote:
[snip]
> This indeed does work. The only difference is that I'm installing the hook
> in __before_publishing_traverse__, so I don't have to do any traversal
> myself.
> 
> I find it a scary solution though (though not as scary as monkeypatching
> __del__), so I'm not 100% sure if I will use this code, or perhaps I'll
> make it very optional (basically, thanks to this nice hack, QuotaFolder can 
> do traffic accounting as well :)

I'll agree that dynamically creating __del__ methods might be a bit 
scary, but I don't see anything too crazy about this method, depending 
of course on exactly what you are doing with RESPONSE. ;^)

You're really just calling something at the last possible second before 
the REQUEST goes away.

-Casey