[Zope-Checkins] CVS: Zope/lib/python/App - ProductContext.py:1.38.36.1

Toby Dickenson tdickenson@geminidataloggers.com
Tue, 9 Apr 2002 08:54:31 -0400


Update of /cvs-repository/Zope/lib/python/App
In directory cvs.zope.org:/tmp/cvs-serv32478/lib/python/App

Modified Files:
      Tag: toby-metatype-branch
	ProductContext.py 
Log Message:
implementation of RestrictedCreation proposal

=== Zope/lib/python/App/ProductContext.py 1.38 => 1.38.36.1 ===
                       permission=None, constructors=(),
                       icon=None, permissions=None, legacy=(),
-                      visibility="Global",interfaces=_marker
+                      visibility="Global",interfaces=_marker,
+                      container_filter=None
         ):
         """Register a constructor
 
@@ -88,6 +89,10 @@
 
         interfaces -- a list of the interfaces the object supports
 
+        container_filter -- function that is called with an ObjectManager
+           object as the only parameter, which should return a true object
+           if the object is happy to be created in that container.
+ 
         """
         app=self.__app
         pack=self.__pack
@@ -171,6 +176,7 @@
               'visibility': visibility,
               'interfaces': interfaces,
               'instance': instance_class,
+              'container_filter': container_filter
               },)
 
         m[name]=initial
@@ -325,3 +331,4 @@
                 ht=APIHelpTopic.APIHelpTopic(file, '', os.path.join(path, file))
                 self.registerHelpTopic(file, ht)
             
+