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
forobject
.
-
modified
(object, *descriptions)¶ Send an
IObjectModifiedEvent
forobject
.descriptions
is a sequence of interfaces or fields which were updated. TheIAttributes
andISequence
helpers can be used.
-
copied
(object, original)¶ Send an
IObjectCopiedEvent
forobject
.original
is the object the copy was created from.
-
moved
(object, oldParent, oldName, newParent, newName)¶ Send an
IObjectMovedEvent
forobject
.oldParent
is the containerobject
was removed from.oldName
was the name used to storeobject
inoldParent
.newParent
is the containerobject
was added to.newName
is the name used to storeobject
innewParent
.Note that
newParent
andoldParent
may be the same if the names are different, and vice versa.
-
added
(object, newParent=None, newName=None)¶ Send an
IObjectAddedEvent
forobject
.newParent
is the containerobject
was added to.newName
is the name used to storeobject
in the container.If either of these is not provided or is
None
, they will be taken from the values ofobject.__parent__
orobject.__name__
, respectively.
-
removed
(object, oldParent=None, oldName=None)¶ Send an
IObjectRemovedEvent
forobject
.oldParent
is the containerobject
was removed from.oldName
was the name used to storeobject
in oldParent.If either of these is not provided or is
None
, they will be taken from the values ofobject.__parent__
orobject.__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 ofNone
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 asAttributes
orSequence
-
-
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
-
class
zope.lifecycleevent.
Attributes
(interface, *attributes)[source]¶ Describes modified attributes of an interface.
-
class
zope.lifecycleevent.
Sequence
(interface, *keys)[source]¶ 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
forobject
.descriptions
is a sequence of interfaces or fields which were updated. TheIAttributes
andISequence
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
forobject
.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
forobject
.oldParent
is the containerobject
was removed from.oldName
was the name used to storeobject
inoldParent
.newParent
is the containerobject
was added to.newName
is the name used to storeobject
innewParent
.Note that
newParent
andoldParent
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
ornewName
is not provided or isNone
, they will be taken from the values ofobject.__parent__
orobject.__name__
, respectively.
-
zope.lifecycleevent.
added
(object, newParent=None, newName=None)[source]¶ Send an
IObjectAddedEvent
forobject
.newParent
is the containerobject
was added to.newName
is the name used to storeobject
in the container.If either of these is not provided or is
None
, they will be taken from the values ofobject.__parent__
orobject.__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
oroldName
is not provided or isNone
, they will be taken from the values ofobject.__parent__
orobject.__name__
, respectively.
-
zope.lifecycleevent.
removed
(object, oldParent=None, oldName=None)[source]¶ Send an
IObjectRemovedEvent
forobject
.oldParent
is the containerobject
was removed from.oldName
was the name used to storeobject
in oldParent.If either of these is not provided or is
None
, they will be taken from the values ofobject.__parent__
orobject.__name__
, respectively.