[Zope3-checkins] CVS: Zope3/src/zope/app/interfaces/container - __init__.py:1.11
Steve Alexander
steve@cat-box.net
Sun, 15 Jun 2003 12:38:30 -0400
Update of /cvs-repository/Zope3/src/zope/app/interfaces/container
In directory cvs.zope.org:/tmp/cvs-serv22217/src/zope/app/interfaces/container
Modified Files:
__init__.py
Log Message:
Made ContainerSized depend on IReadContainer not IContainer.
Made ZopeItemWriteContainerDecorator, and IItemWriteContainer and
IZopeItemWriteContainer interfaces to express the dependency that
writing to a ZopeContainer has on IItemContainer.
Added zcml to make these different kinds of decorators work.
=== Zope3/src/zope/app/interfaces/container/__init__.py 1.10 => 1.11 ===
--- Zope3/src/zope/app/interfaces/container/__init__.py:1.10 Mon Mar 31 09:48:41 2003
+++ Zope3/src/zope/app/interfaces/container/__init__.py Sun Jun 15 12:38:29 2003
@@ -82,6 +82,9 @@
Raises a KeyError if the object is not found.
"""
+class IItemWriteContainer(IWriteContainer, IItemContainer):
+ """A write container that also supports minimal reads."""
+
class IContentContainer(IWriteContainer):
"""Containers (like folders) that contain ordinary content"""
@@ -187,7 +190,7 @@
"""
def __delitem__(key):
- """Delete the keyd object from the context of the container.
+ """Delete the keyed object from the context of the container.
Raises a KeyError if the object is not found.
@@ -203,6 +206,16 @@
IObjectRemovedEvent is published. The event object will be the
container.
"""
+
+class IZopeItemWriteContainer(IZopeWriteContainer, IZopeItemContainer):
+ """An IZopeWriteContainer for writable item containers.
+
+ 'setObject' and '__delitem__' of IZopeWriteContainer imply being able
+ to get at an object after it has been added to the container, or
+ before it has been deleted from the container.
+ This interface makes that contract explicit, and also offers to
+ make '__getitem__' context-aware.
+ """
class IZopeContainer(IZopeReadContainer, IZopeWriteContainer, IContainer):
"""Readable and writable content container."""