src/pyams_workflow/workflow.py
changeset 4 08e003da5f9e
parent 3 709aec888463
child 11 f25326715002
--- a/src/pyams_workflow/workflow.py	Wed Mar 18 10:10:59 2015 +0100
+++ b/src/pyams_workflow/workflow.py	Wed May 20 12:43:47 2015 +0200
@@ -27,8 +27,10 @@
 from pyams_utils.traversing import get_parent
 from pyramid.httpexceptions import HTTPUnauthorized
 from pyramid.threadlocal import get_current_registry
+from zope.componentvocabulary.vocabulary import UtilityVocabulary
 from zope.interface import implementer
 from zope.lifecycleevent import ObjectModifiedEvent
+from zope.schema.vocabulary import getVocabularyRegistry
 
 
 def NullCondition(wf, context):
@@ -247,3 +249,12 @@
         # now filter these transitions to retrieve all possible
         # transitions in this context, and return their ids
         return [transition for transition in transitions if transition.trigger == trigger]
+
+
+class WorkflowsVocabulary(UtilityVocabulary):
+    """Workflows vocabulary"""
+
+    interface = IWorkflow
+    nameOnly = True
+
+getVocabularyRegistry().register('PyAMS workflows', WorkflowsVocabulary)