)
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
+ master_file = forms.CharField(label=u"Plik główny", max_length=500, required=False)
executable = forms.CharField(label=u"Plik wykonywalny", max_length=500, required=False)
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)
def clean(self):
data = super(JobDescriptionForm, self).clean()
+ if data['application'] and not data['master_file']:
+ self.add_error('master_file', u"W trybie uruchamiania aplikacji należy podać plik główny")
+
notify_type = data.get('notify_type')
data['notify'] = u'{}:{}'.format(notify_type, data['notify_address']) if notify_type else ''
def clean_executable(self):
return self._gsiftp_suffix(self.cleaned_data['executable'])
+ def clean_master_file(self):
+ return self._gsiftp_suffix(self.cleaned_data['master_file'])
+
def clean_nodes(self):
return map(int, self.cleaned_data['nodes'].split(':', 2)) if self.cleaned_data['nodes'] else ''