[Zope3-checkins] CVS: Zope3/src/zope/app/browser/services/configuration - __init__.py:1.6 useconfiguration.pt:1.4

Guido van Rossum guido@python.org
Wed, 30 Apr 2003 12:09:22 -0400


Update of /cvs-repository/Zope3/src/zope/app/browser/services/configuration
In directory cvs.zope.org:/tmp/cvs-serv27383

Modified Files:
	__init__.py useconfiguration.pt 
Log Message:
Show the 'usageSummary' in the description rather than the name; for
some objects types, the name alone is not enough (and may even be
empty).


=== Zope3/src/zope/app/browser/services/configuration/__init__.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/browser/services/configuration/__init__.py:1.5	Mon Apr 28 11:54:11 2003
+++ Zope3/src/zope/app/browser/services/configuration/__init__.py	Wed Apr 30 12:09:21 2003
@@ -89,6 +89,10 @@
         result = []
         for path in useconfig.usages():
             config = traverse(component, path)
+            description = None
+            summaryMethod = getattr(config, "usageSummary", None)
+            if summaryMethod:
+                description = summaryMethod()
             url = getView(config, 'absolute_url', self.request)
             # XXX This assumes the configuration implements
             #     INamedComponentConfiguration rather than just
@@ -101,6 +105,7 @@
                            'path': path,
                            'url': url(),
                            'status': config.status,
+                           'description': description or config.name,
                            })
         return result
 


=== Zope3/src/zope/app/browser/services/configuration/useconfiguration.pt 1.3 => 1.4 ===
--- Zope3/src/zope/app/browser/services/configuration/useconfiguration.pt:1.3	Mon Apr 28 11:54:11 2003
+++ Zope3/src/zope/app/browser/services/configuration/useconfiguration.pt	Wed Apr 30 12:09:21 2003
@@ -10,9 +10,8 @@
 
 	  <a href="http://."
 	     tal:attributes="href use/url"
-	     tal:content="use/name">
-	   Example Object
-	   </a> (<span tal:replace="use/status">Active</span>)
+	     tal:content="use/description">Description</a>
+	  (<span tal:replace="use/status">Active</span>)
 
 	</li>
       </ul>