X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?a=blobdiff_plain;f=qcg%2Fforms.py;h=74eec3710a1b0ca89947cefa7ddf7ff57b23d1ec;hb=30676926ef79a0e6b9bade2ad277c82a322f5f3d;hp=33eeeaf24aa17e173e961111219ff099e47af849;hpb=73e8a4e152c693adff71a4252d8e623419be31c7;p=qcg-portal.git diff --git a/qcg/forms.py b/qcg/forms.py index 33eeeaf..74eec37 100644 --- a/qcg/forms.py +++ b/qcg/forms.py @@ -136,9 +136,9 @@ class JobDescriptionForm(forms.Form): 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='', @@ -169,6 +169,9 @@ class JobDescriptionForm(forms.Form): 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() @@ -196,10 +199,13 @@ class JobDescriptionForm(forms.Form): data['postprocess'] = '' def clean_application(self): - return self.cleaned_data['application'].split('/', 1) + return self.cleaned_data['application'].split('/', 1) if self.cleaned_data['application'] else '' + + def clean_executable(self): + return 'gsiftp://' + self.cleaned_data['executable'] if self.cleaned_data['executable'] else '' def clean_nodes(self): - return map(int, self.cleaned_data['nodes'].split(':', 2)) if self.cleaned_data['nodes'] else None + return map(int, self.cleaned_data['nodes'].split(':', 2)) if self.cleaned_data['nodes'] else '' class EnvForm(forms.Form):