TransientObjectContainer - Manage

Transient Object Containers

A Transient Object Container contains objects which expire after a user-settable period of time. Items placed into transient object must have string keys, but may have any type of value.

Common Usages

A Transient Object Container is used by Session Data Mangers to store session data.

Editing Form

Add and Delete Scripts

Add and Delete scripts are Zope scripts which are called, respectively, when an object is added or removed from a Transient Object Container. An add or delete script is specified by naming it by its full Zope object path with slash separators, e.g. "/path/to/method".

Add and delete scripts are called with two arguments. The first argument is the item being added or removed from the container; the second argument is the Transient Object Container itself. The container will be acquisition wrapped, allowing the it to be used as a context to reference other Zope objects.

An example of an External Method used as a delete script:

             def deleteScript(item, container):
                 from logging import getLogger
                 LOG = getLogger('test')
                 LOG.info('id: %s' % item.getId())

See Also