--- a/src/ztfy/utils/zodb.py Thu Sep 20 17:06:22 2012 +0200
+++ b/src/ztfy/utils/zodb.py Thu Sep 20 19:13:01 2012 +0200
@@ -17,11 +17,12 @@
# import standard packages
from persistent import Persistent
+from persistent.interfaces import IPersistent
+from transaction.interfaces import ITransactionManager
# import Zope3 interfaces
-from persistent.interfaces import IPersistent
-from transaction.interfaces import ITransactionManager
from ZODB.interfaces import IConnection
+from zope.schema.interfaces import IVocabularyFactory
# import local interfaces
from ztfy.utils.interfaces import IZEOConnection
@@ -30,8 +31,9 @@
from ZEO import ClientStorage
from ZODB import DB
from zope.component import adapter
+from zope.componentvocabulary.vocabulary import UtilityVocabulary
from zope.container.contained import Contained
-from zope.interface import implementer, implements
+from zope.interface import implementer, implements, classProvides
from zope.schema.fieldproperty import FieldProperty
# import local packages
@@ -65,6 +67,14 @@
"""Persistent ZEO connection settings utility"""
+class ZEOConnectionVocabulary(UtilityVocabulary):
+ """ZEO connections vocabulary"""
+
+ classProvides(IVocabularyFactory)
+
+ interface = IZEOConnection
+ nameOnly = True
+
# IPersistent adapters copied from zc.twist package
# also register this for adapting from IConnection
--- a/src/ztfy/utils/zodb.zcml Thu Sep 20 17:06:22 2012 +0200
+++ b/src/ztfy/utils/zodb.zcml Thu Sep 20 19:13:01 2012 +0200
@@ -18,4 +18,8 @@
permission="zope.ManageServices" />
</class>
+ <utility
+ name="ZEO connections"
+ component=".zodb.ZEOConnectionVocabulary" />
+
</configure>
\ No newline at end of file