X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?a=blobdiff_plain;f=qcg%2Fforms.py;h=c1fda14f92d066063c6da6a402a2bd7c5186542b;hb=d69ee57dd7b06a9c6f4c9c65c065e66306537088;hp=ea0804683037478d88816c882abb74f6f5e5436f;hpb=1547dbc536b4848a93ce0a39493c0c69b853c576;p=qcg-portal.git diff --git a/qcg/forms.py b/qcg/forms.py index ea08046..c1fda14 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) @@ -124,7 +125,7 @@ class JobDescriptionForm(forms.Form): grant = forms.CharField(label=u"Grant", max_length=100, required=False) hosts = forms.MultipleChoiceField(label=u"Host", choices=Host.CHOICES, required=False) - properties = forms.MultipleChoiceField(label=u"Właściwości węzłów", required=False) + properties = forms.CharField(label=u"Właściwości węzłów", required=False) queue = forms.ChoiceField(choices=QUEUE_CHOICES, label=u"Kolejka", required=False) procs = forms.IntegerField(label=u"Liczba procesów", min_value=0, required=False) nodes = forms.CharField(label=u"Topologia węzłów", max_length=10, validators=[nodes_validator], required=False) @@ -136,8 +137,8 @@ class JobDescriptionForm(forms.Form): # 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) + 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='', @@ -166,8 +167,9 @@ class JobDescriptionForm(forms.Form): # accept user defined choices self.fields['queue'].choices += ((data.get('queue'), data.get('queue')), ) 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['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,11 +197,19 @@ 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)) + return map(int, self.cleaned_data['nodes'].split(':', 2)) if self.cleaned_data['nodes'] else '' + + def clean_input(self): + return 'gsiftp://' + self.cleaned_data['input'] if self.cleaned_data['input'] else '' + def clean_stage_in(self): + return ['gsiftp://' + item for item in self.cleaned_data['stage_in']] class EnvForm(forms.Form): name = forms.CharField(label=u"Nazwa", max_length=100, validators=[env_name_validator],