X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?a=blobdiff_plain;f=qcg%2Fforms.py;h=74eec3710a1b0ca89947cefa7ddf7ff57b23d1ec;hb=30676926ef79a0e6b9bade2ad277c82a322f5f3d;hp=f66ada600b7e80192d7b2cd9edabe02bfcce96a9;hpb=07160bcc9fb6355721773058d3fa236021f8c534;p=qcg-portal.git diff --git a/qcg/forms.py b/qcg/forms.py index f66ada6..74eec37 100644 --- a/qcg/forms.py +++ b/qcg/forms.py @@ -117,6 +117,7 @@ class JobDescriptionForm(forms.Form): ) 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) @@ -135,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='', @@ -168,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() @@ -195,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):