--- a/src/pyams_utils/zmi/zeo.py Wed Apr 15 14:22:37 2015 +0200
+++ b/src/pyams_utils/zmi/zeo.py Wed Apr 15 14:23:20 2015 +0200
@@ -16,6 +16,7 @@
# import standard library
# import interfaces
+from pyams_skin.interfaces.container import ITableElementName
from pyams_skin.interfaces.viewlet import IToolbarAddingMenu
from pyams_skin.layer import IPyAMSLayer
from pyams_utils.interfaces.zeo import IZEOConnection
@@ -27,6 +28,7 @@
from pyams_form.form import AJAXAddForm, AJAXEditForm
from pyams_pagelet.pagelet import pagelet_config
from pyams_skin.viewlet.toolbar import ToolbarMenuItem
+from pyams_utils.adapter import adapter_config, ContextRequestAdapter
from pyams_utils.registry import query_utility
from pyams_utils.url import absolute_url
from pyams_utils.zodb import ZEOConnectionUtility
@@ -41,6 +43,16 @@
from pyams_utils import _
+@adapter_config(context=(IZEOConnection, IAdminLayer), provides=ITableElementName)
+class ZEOConnectionNameAdapter(ContextRequestAdapter):
+ """ZEO connection name adapter"""
+
+ @property
+ def name(self):
+ translate = self.request.localizer.translate
+ return translate(_("ZEO: {0}")).format(self.context.name)
+
+
@viewlet_config(name='add-zeo-connection.menu', context=ISite, layer=IAdminLayer,
view=UtilitiesTable, manager=IToolbarAddingMenu, permission='system.manage')
class ZEOConnectionAddMenu(ToolbarMenuItem):