[Zope3-checkins] CVS: Zope3/src/zope/app/interfaces/services - connection.py:1.5

Guido van Rossum guido@python.org
Thu, 24 Apr 2003 10:36:54 -0400


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

Modified Files:
	connection.py 
Log Message:
Make it so the component path can't be changed in the edit form.
Add XXX comments pointing out unresolved issues.


=== Zope3/src/zope/app/interfaces/services/connection.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/interfaces/services/connection.py:1.4	Tue Apr 22 14:02:55 2003
+++ Zope3/src/zope/app/interfaces/services/connection.py	Thu Apr 24 10:36:54 2003
@@ -15,25 +15,40 @@
 
 $Id$
 """
-from zope.app.services.field import ComponentPath
-from zope.app.interfaces.services import configuration 
+
+from zope.schema import TextLine
+from zope.app.interfaces.services.configuration import IComponentConfiguration
+from zope.app.interfaces.services.configuration import ComponentPath
 from zope.app.interfaces.rdb import IZopeDatabaseAdapter
 from zope.app.interfaces.rdb import IConnectionService
 from zope.app.interfaces.services.configuration \
         import INameComponentConfigurable
 
-class IConnectionConfiguration(configuration.INamedComponentConfiguration):
+class IConnectionConfiguration(IComponentConfiguration):
     """Database Connection Configuration
 
     Connection configurations are dependent on the database adapters that they
     configure. They register themselves as component dependents.
     """
+
+    name = TextLine(title=u"Name",
+                    description=u"The name that is registered",
+                    readonly=True,
+                    required=True,
+                    # XXX And yet, an empty name is accepted???
+                    )
     
     componentPath = ComponentPath(
-        type=IZopeDatabaseAdapter,
         title=u"Component path",
         description=u"The physical path to the component",
+        readonly=True,
         required=True)
+
+    # XXX There's still a problem with the inherited 'permission'.
+    #     Even though it is not optional, when not specified
+    #     upon creation, the creation fails with a
+    #       KeyError: 'permission'
+    #     in zope/app/browser/form/add.py on line 85.
 
 
 class ILocalConnectionService(IConnectionService, INameComponentConfigurable):