Reference

Interfaces

Event-related interfaces

interface zope.lifecycleevent.interfaces.IZopeLifecycleEvent[source]

High-level functions for sending events.

These are implemented by the zope.lifecycleevent module.

created(object)

Send an IObjectCreatedEvent for object.

modified(object, *descriptions)

Send an IObjectModifiedEvent for object.

descriptions is a sequence of interfaces or fields which were updated. The IAttributes and ISequence helpers can be used.

copied(object, original)

Send an IObjectCopiedEvent for object.

original is the object the copy was created from.

moved(object, oldParent, oldName, newParent, newName)

Send an IObjectMovedEvent for object.

oldParent is the container object was removed from. oldName was the name used to store object in oldParent. newParent is the container object was added to. newName is the name used to store object in newParent.

Note that newParent and oldParent may be the same if the names are different, and vice versa.

added(object, newParent=None, newName=None)

Send an IObjectAddedEvent for object.

newParent is the container object was added to. newName is the name used to store object in the container.

If either of these is not provided or is None, they will be taken from the values of object.__parent__ or object.__name__, respectively.

removed(object, oldParent=None, oldName=None)

Send an IObjectRemovedEvent for object.

oldParent is the container object was removed from. oldName was the name used to store object in oldParent.

If either of these is not provided or is None, they will be taken from the values of object.__parent__ or object.__name__, respectively.

interface zope.lifecycleevent.interfaces.IObjectCreatedEvent[source]

Extends: zope.interface.interfaces.IObjectEvent

An object has been created.

The object attribute will commonly have a value of None for its __name__ and __parent__ values (if it has those attributes at all).

interface zope.lifecycleevent.interfaces.IObjectCopiedEvent[source]

Extends: zope.lifecycleevent.interfaces.IObjectCreatedEvent

An object has been copied.

original

The original from which the copy was made.

interface zope.lifecycleevent.interfaces.IObjectModifiedEvent[source]

Extends: zope.interface.interfaces.IObjectEvent

An object has been modified

descriptions

The supplied modification descriptions.

These may be interfaces or implementations of IModificationDescription such as Attributes or Sequence

interface zope.lifecycleevent.interfaces.IModificationDescription[source]

Marker interface for descriptions of object modifications.

Can be used as a parameter of an IObjectModifiedEvent.

interface zope.lifecycleevent.interfaces.IAttributes[source]

Extends: zope.lifecycleevent.interfaces.IModificationDescription

Describes the attributes of an interface.

interface

The involved interface.

attributes

A sequence of modified attributes.

interface zope.lifecycleevent.interfaces.ISequence[source]

Extends: zope.lifecycleevent.interfaces.IModificationDescription

Describes the modified keys of a sequence-like interface.

interface

The involved interface.

keys

A sequence of modified keys.

interface zope.lifecycleevent.interfaces.IObjectMovedEvent[source]

Extends: zope.interface.interfaces.IObjectEvent

An object has been moved.

oldParent

The old location parent for the object.

oldName

The old location name for the object.

newParent

The new location parent for the object.

newName

The new location name for the object.

interface zope.lifecycleevent.interfaces.IObjectAddedEvent[source]

Extends: zope.lifecycleevent.interfaces.IObjectMovedEvent

An object has been added to a container.

interface zope.lifecycleevent.interfaces.IObjectRemovedEvent[source]

Extends: zope.lifecycleevent.interfaces.IObjectMovedEvent

An object has been removed from a container.

Implementation

Life cycle events.

This module provides the IZopeLifecycleEvent interface, in addition to concrete classes implementing the various event interfaces.

class zope.lifecycleevent.ObjectCreatedEvent(object)[source]

Bases: zope.interface.interfaces.ObjectEvent

An object has been created

zope.lifecycleevent.created(object)[source]

Send an IObjectCreatedEvent for object.

class zope.lifecycleevent.Attributes(interface, *attributes)[source]

Bases: object

Describes modified attributes of an interface.

class zope.lifecycleevent.Sequence(interface, *keys)[source]

Bases: object

Describes modified keys of an interface.

class zope.lifecycleevent.ObjectModifiedEvent(object, *descriptions)[source]

Bases: zope.interface.interfaces.ObjectEvent

An object has been modified

Init with a list of modification descriptions.

zope.lifecycleevent.modified(object, *descriptions)[source]

Send an IObjectModifiedEvent for object.

descriptions is a sequence of interfaces or fields which were updated. The IAttributes and ISequence helpers can be used.

class zope.lifecycleevent.ObjectCopiedEvent(object, original)[source]

Bases: zope.lifecycleevent.ObjectCreatedEvent

An object has been copied

zope.lifecycleevent.copied(object, original)[source]

Send an IObjectCopiedEvent for object.

original is the object the copy was created from.

class zope.lifecycleevent.ObjectMovedEvent(object, oldParent, oldName, newParent, newName)[source]

Bases: zope.interface.interfaces.ObjectEvent

An object has been moved

zope.lifecycleevent.moved(object, oldParent, oldName, newParent, newName)[source]

Send an IObjectMovedEvent for object.

oldParent is the container object was removed from. oldName was the name used to store object in oldParent. newParent is the container object was added to. newName is the name used to store object in newParent.

Note that newParent and oldParent may be the same if the names are different, and vice versa.

class zope.lifecycleevent.ObjectAddedEvent(object, newParent=None, newName=None)[source]

Bases: zope.lifecycleevent.ObjectMovedEvent

An object has been added to a container.

If newParent or newName is not provided or is None, they will be taken from the values of object.__parent__ or object.__name__, respectively.

zope.lifecycleevent.added(object, newParent=None, newName=None)[source]

Send an IObjectAddedEvent for object.

newParent is the container object was added to. newName is the name used to store object in the container.

If either of these is not provided or is None, they will be taken from the values of object.__parent__ or object.__name__, respectively.

class zope.lifecycleevent.ObjectRemovedEvent(object, oldParent=None, oldName=None)[source]

Bases: zope.lifecycleevent.ObjectMovedEvent

An object has been removed from a container.

If oldParent or oldName is not provided or is None, they will be taken from the values of object.__parent__ or object.__name__, respectively.

zope.lifecycleevent.removed(object, oldParent=None, oldName=None)[source]

Send an IObjectRemovedEvent for object.

oldParent is the container object was removed from. oldName was the name used to store object in oldParent.

If either of these is not provided or is None, they will be taken from the values of object.__parent__ or object.__name__, respectively.