[Zope3-checkins] CVS: Zope3/src/zope/app/interfaces/services - folder.py:1.7

Jim Fulton cvs-admin at zope.org
Wed Dec 3 00:41:27 EST 2003


Update of /cvs-repository/Zope3/src/zope/app/interfaces/services
In directory cvs.zope.org:/tmp/cvs-serv19231/src/zope/app/interfaces/services

Modified Files:
	folder.py 
Log Message:
Added a containment constraint so that only registerable
objects can be added.


=== Zope3/src/zope/app/interfaces/services/folder.py 1.6 => 1.7 ===
--- Zope3/src/zope/app/interfaces/services/folder.py:1.6	Fri Aug  8 11:23:21 2003
+++ Zope3/src/zope/app/interfaces/services/folder.py	Wed Dec  3 00:41:26 2003
@@ -16,29 +16,32 @@
 $Id$
 """
 
-from zope.app.interfaces.container import IAdding, IContainer
-from zope.app.interfaces.services.service import IComponentManager
+import zope.app.interfaces.services.registration 
+import zope.app.interfaces.container
+import zope.app.interfaces.services.service
 from zope.app.interfaces.services.registration \
      import IRegistrationManagerContainer
+from zope.app.container.constraints import ItemTypePrecondition
 
-class ISiteManagementFolder(IContainer, IRegistrationManagerContainer):
+class ISiteManagementFolder(
+    zope.app.interfaces.container.IContainer,
+    zope.app.interfaces.services.registration.IRegistrationManagerContainer,
+    ):
     """Component and component registration containers."""
 
-
-class ISiteManagementFolders(IContainer, IComponentManager):
+    def __setitem__(name, object):
+        """Add a registerable object
+        """
+    __setitem__.precondition = ItemTypePrecondition(
+        zope.app.interfaces.services.registration.IRegisterable)
+
+class ISiteManagementFolders(
+    zope.app.interfaces.container.IContainer,
+    zope.app.interfaces.services.service.IComponentManager,
+    ):
     """A collection of ISiteManagementFolder objects.
 
     An ISiteManagementFolders object supports simple containment as
     well as package query and lookup.
     
-    """
-
-class ISiteManagementFolderAdding(IAdding):
-    """A special package that is not content but is similar to a folder.
-    
-    The SiteManagementFolder Adding is special, since it is not part
-    of the content namespace, but has a similar functionality as a
-    Folder. Therefore there are views that overlap; this interface was
-    created so that there are no registration conflicts.
-
     """




More information about the Zope3-Checkins mailing list