Sort WorkflowAction classes from the get_all() method.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -50,7 +50,11 @@ class WorkflowAction(six.with_metaclass(WorkflowActionMetaclass, WorkflowActionB
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_all(cls):
|
def get_all(cls):
|
||||||
return cls._registry
|
return sorted(cls._registry.values(), key=lambda x: x.label)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def id(cls):
|
||||||
|
return '{}.{}'.format(cls.__module__, cls.__name__)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def initialize():
|
def initialize():
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ class WorkflowActionSelectionForm(forms.Form):
|
|||||||
|
|
||||||
self.fields['klass'].choices = [
|
self.fields['klass'].choices = [
|
||||||
(
|
(
|
||||||
key, klass.label
|
klass.id(), klass.label
|
||||||
) for key, klass in WorkflowAction.get_all().items()
|
) for klass in WorkflowAction.get_all()
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user