Task Forms
Tasks can be given input in the form of a dictionary. A user interface for pydra requires a definition of what those values are, how to render them, and how to validate them. Pydra uses Django Forms to provide this definition and validation.
Tasks with a form attached to them will have the form displayed when the user clicks the run button in the user interface.
Attaching a Form to a Task
Define your form. All syntax and functionality of Django forms should work.
class TestTaskInput(forms.Form):
start = forms.IntegerField(initial='0', help_text='Start counting with this number')
end = forms.IntegerField(initial='5', help_text='End counting with this number')
Set the form for the task by setting Task.form to the class object for the form. Each instance of the task will generate a new instance of the form when a request to start it is received.
class TestTask(Task):
form = TestTaskInput
Help Text
setting the help text on a form will cause help bubbles to appear as the user enters values into the form.
Forms With All Optional Values
Forms can contain all optional values, or all fields with defaults. The form will still be displayed to the user. At some point the interface will be updated to add a run with defaults button to bypass the form entry popup.
Subtasks with Forms
Currently only the form for the parent task is displayed for the user. It is assumed that the parent task will provide all required arguments to its children. At some point form aggregating or collections of forms will be possible to make it easier to add fields. For now if fields from a subtask's form are needed, the parent form can extend from the subtask form.
Multipart Forms
Multipart forms do not currently work with Pydra.

