Implement field order for the action dynamic forms.

Perform action class validation by importing the class and
not relying on an instance of action model, which might not
exisit when still creating the action.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2017-08-26 22:03:19 -04:00
parent f417219f61
commit 0337ab5d92
2 changed files with 22 additions and 10 deletions

View File

@@ -76,7 +76,12 @@ class WorkflowAction(six.with_metaclass(WorkflowActionMetaclass, WorkflowActionB
self.form_data = form_data
def get_form_schema(self, request=None):
return {
result = {
'fields': self.fields or (),
'widgets': getattr(self, 'widgets', {})
}
if hasattr(self, 'field_order'):
result['field_order'] = self.field_order
return result