[prev in list] [next in list] [prev in thread] [next in thread]
List: zope
Subject: [Zope] Re: [Zope-dev] post-publishing hook
From: Ivo van der Wijk <ivo () amaze ! nl>
Date: 2002-11-29 18:33:06
[Download RAW message or body]
On Fri, Nov 29, 2002 at 01:07:24PM +0100, Carlo Giomini wrote:
> Dear all,
> I need a sort of post-publishing hook (so to say). I need Zope to call a
> function of mine as the very last action of publishing a request, i.e. after
> having built the response (and sent it to the browser possibly), but
> before starting publishing a new request. My Zope server is running as a
> single-threaded app.
> Does Zope support this any way?
>
There is a way, but I find it somewhat ugly/hackish. But Shane uses it
in CookieCrumbler, so it must be good ;)
You can pass an instance to REQUEST._hold, which should be deleted
when REQUEST gets deleted, so at the complete end of the request.
This means you can pass an instance to a class that defines a __del__
method, where you can do your work.
You'll be working outside the REQUEST transaction at that moment, so please
keep that in mind when modifying objects.
Cheers
Ivo
--
Drs. I.R. van der Wijk -=-
Brouwersgracht 132 Amaze Internet Services V.O.F.
1013 HA Amsterdam, NL -=-
T +31-20-4688336 F +31-20-4688337 Linux/Web/Zope/SQL/MMBase
W http://www.amaze.nl E info@amaze.nl Network Solutions
W http://vanderwijk.info E ivo@amaze.nl Consultancy
PGP http://vanderwijk.info/pgp -=-
_______________________________________________
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 )
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic