)
application = forms.ChoiceField(choices=APPLICATION_CHOICES, label=u"Aplikacja", required=False) # TODO choices
+ master_file = forms.CharField(label=u"Plik główny", max_length=500, required=False) # TODO grid ftp
executable = forms.CharField(label=u"Plik wykonywalny", max_length=500, required=False) # TODO grid ftp
script = forms.CharField(label=u"Skrypt", widget=forms.Textarea(attrs={'rows': 2, 'cols': 40}), required=False) # TODO saving to grid ftp
arguments = forms.MultipleChoiceField(label=u"Argumenty", required=False)
reservation = forms.CharField(label=u"Rezerwacja", max_length=100, required=False)
# TODO grid ftp
- input = forms.CharField(label=u"Standardowe wejście", max_length=500, required=False)
- stage_in = forms.CharField(label=u"Stage in", max_length=500, required=False)
- stage_out = forms.CharField(label=u"Stage out", max_length=500, required=False)
+ input = forms.MultipleChoiceField(label=u"Standardowe wejście", required=False)
+ stage_in = forms.MultipleChoiceField(label=u"Stage in", required=False)
+ # stage_out = forms.MultipleChoiceField(label=u"Stage out", required=False)
monitoring = forms.BooleanField(label=u"Portal QCG-Monitoring", required=False)
notify_type = forms.ChoiceField(label=u"Monitorowanie stanu", choices=PROTOCOL_CHOICES, required=False, initial='',
self.fields['arguments'].choices += ((v, v) for v in data.getlist('arguments'))
self.fields['properties'].choices += ((v, v) for v in data.getlist('properties'))
self.fields['native'].choices += ((v, v) for v in data.getlist('native'))
+ self.fields['input'].choices += ((v, v) for v in data.getlist('input'))
+ self.fields['stage_in'].choices += ((v, v) for v in data.getlist('stage_in'))
+ # self.fields['stage_out'].choices += ((v, v) for v in data.getlist('stage_out'))
def clean(self):
data = super(JobDescriptionForm, self).clean()
data['postprocess'] = ''
def clean_application(self):
- value = self.cleaned_data['application']
+ return self.cleaned_data['application'].split('/', 1) if self.cleaned_data['application'] else ''
- if '/' in value:
- return value.split('/', 1)
-
- return value, None
+ def clean_executable(self):
+ return 'gsiftp://' + self.cleaned_data['executable'] if self.cleaned_data['executable'] else ''
def clean_nodes(self):
- value = map(int, self.cleaned_data['nodes'].split(':', 2))
-
- if len(value) == 3:
- return tuple(value)
-
- nodes, slots = value
- return nodes, slots, slots
+ return map(int, self.cleaned_data['nodes'].split(':', 2)) if self.cleaned_data['nodes'] else ''
class EnvForm(forms.Form):