ignore . and .. in directory listing
[qcg-portal.git] / qcg / forms.py
index 74eec37..c1fda14 100644 (file)
@@ -125,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,7 +136,7 @@ class JobDescriptionForm(forms.Form):
     reservation = forms.CharField(label=u"Rezerwacja", max_length=100, required=False)
 
     # TODO grid ftp
-    input = forms.MultipleChoiceField(label=u"Standardowe wejście", required=False)
+    input = forms.CharField(label=u"Standardowe wejście", 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)
 
@@ -167,9 +167,7 @@ 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['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'))
 
@@ -207,6 +205,11 @@ class JobDescriptionForm(forms.Form):
     def clean_nodes(self):
         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],