The Session Data Object exposes the Transience Interfaces setDelNotificationTarget(self, f ) and setAddNotificationTarget(self, f) which register f to be called when a session object is added or deleted. The registered function is supposed to accept a single argument, item, the object being added or removed. So, how does one write a PythonScript to do this? Or must it be an External Method and/or a product Extension? It should be straightforward enough as it's part of the normally exposed interface.
The registered function can be either a path or a string representing a Zope object path. So use the Zope object path to a python script if you want to register a callback to a Python Script programatically. It registered function actually accepts two arguments: the first argument is the session data object being added or expired. The second argument is the transient object container which contains the session data object. This will be better documented in an upcoming release of the Zope Book. On Sat, 2002-08-10 at 23:02, Dennis Allison wrote:
The Session Data Object exposes the Transience Interfaces
setDelNotificationTarget(self, f )
and
setAddNotificationTarget(self, f)
which register f to be called when a session object is added or deleted. The registered function is supposed to accept a single argument, item, the object being added or removed.
So, how does one write a PythonScript to do this? Or must it be an External Method and/or a product Extension? It should be straightforward enough as it's part of the normally exposed interface.
_______________________________________________ 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 )
Note that I have made the Zope Book version including the better session docs I referred to below available at http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/Sessions.s tx . This is "development documentation" so let me know if there are any problems. ----- Original Message ----- From: "Chris McDonough" <chrism@zope.com> To: "Dennis Allison" <allison@sumeru.stanford.EDU> Cc: <zope@zope.org> Sent: Sunday, August 11, 2002 12:14 AM Subject: Re: [Zope] using the Session Data Object hooks
The registered function can be either a path or a string representing a Zope object path. So use the Zope object path to a python script if you want to register a callback to a Python Script programatically.
It registered function actually accepts two arguments: the first argument is the session data object being added or expired. The second argument is the transient object container which contains the session data object.
This will be better documented in an upcoming release of the Zope Book.
On Sat, 2002-08-10 at 23:02, Dennis Allison wrote:
The Session Data Object exposes the Transience Interfaces
setDelNotificationTarget(self, f )
and
setAddNotificationTarget(self, f)
which register f to be called when a session object is added or deleted. The registered function is supposed to accept a single argument, item, the object being added or removed.
So, how does one write a PythonScript to do this? Or must it be an External Method and/or a product Extension? It should be straightforward enough as it's part of the normally exposed interface.
_______________________________________________ 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 )
_______________________________________________ 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 )
participants (2)
-
Chris McDonough -
Dennis Allison