def WorkflowStates(content): wf = IWorkflow(content, None) if wf is None: return SimpleVocabulary(()) terms = [] for state in wf.getStates(): term = SimpleTerm(state.id, state.id, state.title) term.state = state.description terms.append((state.title, term)) terms.sort() return SimpleVocabulary([term for _t, term in terms])