Add support for workflow transition triggers.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2017-08-03 04:01:11 -04:00
parent 4560009927
commit 81f481fadf
14 changed files with 359 additions and 22 deletions

View File

@@ -12,7 +12,7 @@ class Event(object):
@classmethod
def all(cls):
return cls._registry.values()
return Event.sort(event_type_list=cls._registry.values())
@classmethod
def get(cls, name):
@@ -30,6 +30,17 @@ class Event(object):
except KeyError as exception:
return force_text(exception)
@classmethod
def refresh(cls):
for event_type in cls.all():
event_type.get_type()
@staticmethod
def sort(event_type_list):
return sorted(
event_type_list, key=lambda x: x.label
)
def __init__(self, name, label):
self.name = name
self.label = label