+ def clean(self):
+ data = super(JobDescriptionForm, self).clean()
+
+ notify_type = data.get('notify_type')
+ data['notify'] = u'{}:{}'.format(notify_type, data['notify_address']) if notify_type else ''
+
+ wo_type = data.get('watch_output_type')
+ data['watch_output'] = u'{}:{}'.format(wo_type, data['watch_output_address']) if wo_type else ''
+
+ preprocess_type = data.get('preprocess_type')
+ if preprocess_type == self.Process.CMD:
+ data['preprocess'] = data['preprocess_cmd']
+ elif preprocess_type == self.Process.SCRIPT:
+ data['preprocess'] = data['preprocess_script']
+ else:
+ data['preprocess'] = ''
+
+ postprocess_type = data.get('postprocess_type')
+ if postprocess_type == self.Process.CMD:
+ data['postprocess'] = data['postprocess_cmd']
+ elif postprocess_type == self.Process.SCRIPT:
+ data['postprocess'] = data['postprocess_script']
+ else:
+ data['postprocess'] = ''
+
+ def clean_application(self):
+ return self.cleaned_data['application'].split('/', 1)
+
+ def clean_nodes(self):
+ return map(int, self.cleaned_data['nodes'].split(':', 2))
+