[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/workflow/stateful/browser/contentworkflow.py - change the fields of the ContentProcessRegistry to use List.

Eckart Hertzler eckart at hertzler.de
Fri May 14 10:49:09 EDT 2004


Log message for revision 24652:
- change the fields of the ContentProcessRegistry to use List.
  with Choice for value_type. This enables multi select widgets
  for both fields
- change to zapi.getUtilityFor



-=-
Modified: Zope3/trunk/src/zope/app/workflow/stateful/browser/contentworkflow.py
===================================================================
--- Zope3/trunk/src/zope/app/workflow/stateful/browser/contentworkflow.py	2004-05-14 14:12:55 UTC (rev 24651)
+++ Zope3/trunk/src/zope/app/workflow/stateful/browser/contentworkflow.py	2004-05-14 14:49:08 UTC (rev 24652)
@@ -24,7 +24,7 @@
 from zope.app.form.interfaces import IInputWidget
 from zope.interface import Interface
 from zope.app.publisher.browser import BrowserView
-from zope.schema import Choice
+from zope.schema import Choice, List
 from zope.security.proxy import trustedRemoveSecurityProxy 
 from zope.app.workflow.interfaces import IProcessDefinition
 
@@ -36,20 +36,22 @@
 
 class IContentProcessMapping(Interface):
 
-    iface = Choice(
+    iface = List(
         title=u"Content Interface",
         description=u"Specifies the interface that characterizes a particular "
                     u"content type. Select one interface at a time.",
-        vocabulary="Interfaces",        
-        required=True)
+        required=True,
+        value_type=Choice(vocabulary="Interfaces")        
+        )
     
-    name = Choice(
+    name = List(
         title = u"Process Definition Name",
         description = u"The name of the process that will be available for "
                       u"this content type. Feel free to select several at "
                       u"once.",
-        vocabulary = "ProcessDefinitions",
-        required = True)
+        required = True,
+        value_type=Choice(vocabulary = "ProcessDefinitions")
+        )
 
 
 class ManageContentProcessRegistry(BrowserView):
@@ -61,8 +63,8 @@
 
     def getProcessInterfacesMapping(self):
         mapping = []
-        utils = zapi.getService(self.context, Utilities)
-        for name in [name for name, util in utils.getUtilitiesFor(
+        for name in [name for name, util in zapi.getUtilitiesFor(
+                                                       self.context,
                                                        IProcessDefinition)]:
             ifaces = self.context.getInterfacesForProcessName(name)
             ifaces = map(lambda i: interfaceToName(self.context, i), ifaces)




More information about the Zope3-Checkins mailing list