[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ContentDirective - ContentDirective.py:1.1.2.3

Jim Fulton jim@zope.com
Tue, 4 Jun 2002 14:01:24 -0400


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

Modified Files:
      Tag: Zope3InWonderland-branch
	ContentDirective.py 
Log Message:
Modified content/factory directive to default factory id to the dotted class name

=== Zope3/lib/python/Zope/App/ContentDirective/ContentDirective.py 1.1.2.2 => 1.1.2.3 ===
 
     def __init__(self, _context, class_):
+        self.__id = class_
         self.__class = _context.resolve(class_)
         # not used yet
         #self.__name = class_
@@ -86,7 +87,7 @@
         """Like require, but with permission_id Zope.Public"""
         return self.require(_context, PublicPermission, attributes, interface)
 
-    def factory(self, _context, id, permission, title, description='',
+    def factory(self, _context, permission, title, id=None, description='',
                 for_container='', creation_markers=''):
         """Register a zmi factory for this class"""
         if for_container:
@@ -100,6 +101,8 @@
                                       for name in creation_markers.split()])
         else:
             creation_markers = (IGenericCreatorMarker,)
+
+        id = id or self.__id
             
         # note factories are all in one pile, services and content,
         # so addable names must also act as if they were all in the