[Zope-Checkins] CVS: Zope/lib/python/Zope/Startup - datatypes.py:1.6.2.5

Chris McDonough chrism@zope.com
Sat, 2 Aug 2003 18:56:52 -0400


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

Modified Files:
      Tag: Zope-2_7-branch
	datatypes.py 
Log Message:
Merge from HEAD:

Be more careful about specifying a container class: root databases should not have a container class.


=== Zope/lib/python/Zope/Startup/datatypes.py 1.6.2.4 => 1.6.2.5 ===
--- Zope/lib/python/Zope/Startup/datatypes.py:1.6.2.4	Sat Aug  2 13:57:33 2003
+++ Zope/lib/python/Zope/Startup/datatypes.py	Sat Aug  2 18:56:47 2003
@@ -163,10 +163,6 @@
     """ A ZODB database datatype that can handle an extended set of
     attributes for use by DBTab """
 
-    def __init__(self, section):
-        self.container_class = section.container_class or 'OFS.Folder.Folder'
-        ZODBDatabase.__init__(self, section)
-
     def createDB(self):
         return ZODBDatabase.open(self)
 
@@ -214,7 +210,12 @@
         """
         for (virtual_path, real_root, real_path) in self.computeMountPaths():
             if virtual_path == mount_path:
-                return (real_root, real_path, self.container_class)
+                container_class = self.config.container_class
+                if not container_class and virtual_path != '/':
+                    # default to OFS.Folder.Folder for nonroot mounts
+                    # if one isn't specified in the config
+                    container_class = 'OFS.Folder.Folder'
+                return (real_root, real_path, container_class)
         raise LookupError('Nothing known about mount path %s' % mount_path)
     
 def getDefaultDatabaseFactories(context):