From 9e60afe1703b42d67da48280868bdd7d2e4bbc6e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Dawid=20Jagie=C5=82a?= Date: Sun, 6 Sep 2015 22:55:45 +0200 Subject: [PATCH] wlaczony debuging --- qcg/forms.py | 17 +++++++++-------- qcg/templates/qcg/job_submit.html | 1 - qcg/templates/qcg/job_submit_form.html | 8 +++----- qcg/views.py | 12 +++++++++++- 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/qcg/forms.py b/qcg/forms.py index 2708c5e..491ad30 100644 --- a/qcg/forms.py +++ b/qcg/forms.py @@ -91,7 +91,8 @@ class JobDescriptionForm(forms.Form): APPLICATION_CHOICES = ( CHOICES_PLACEHOLDER, - ('unres32', 'UNRES 3.2'), + ('unres-gab', 'UNRES GAB'), + ('unres-e0ll2y', 'UNRES E0LL2Y'), ) QUEUE_CHOICES = ( @@ -101,8 +102,7 @@ class JobDescriptionForm(forms.Form): ('plgrid-testing', 'plgrid-testing'), ) MODULES_CHOICES = ( - ('plgrid/apps/python', 'plgrid/apps/python'), - ('plgrid/apps/matlab', 'plgrid/apps/matlab'), + CHOICES_PLACEHOLDER, ) PROTOCOL_CHOICES = ( ('', u'Brak'), @@ -127,7 +127,7 @@ class JobDescriptionForm(forms.Form): retmin = forms.IntegerField(label=u"RETMIN", help_text=u"Dolny zakres temparatur dla wymiany replik", min_value=2, initial=250, required=False) retmax = forms.IntegerField(label=u"RETMAX", help_text=u"Górny zakres temperatur dla wymiany replik", min_value=2, initial=450, required=False) - application = forms.ChoiceField(choices=APPLICATION_CHOICES, label=u"Aplikacja", required=False, initial='unres32') # TODO choices + application = forms.ChoiceField(choices=APPLICATION_CHOICES, label=u"Aplikacja", required=False, initial='unres-gab') # TODO choices 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) @@ -182,14 +182,15 @@ class JobDescriptionForm(forms.Form): data = super(JobDescriptionForm, self).clean() force_field = data.get('force_field') - if force_field == self.FORCE_FIELD_CHOICES[0]: + + if force_field == u'GAB': data['application'] = [u'unres-gab'] else: data['application'] = [u'unres-e0ll2y'] - if data['master_file']: - self.add_error('master_file', u"Należy podać plik główny") - + '''if data['master_file']: + self.add_error('master_file', u"Należy podać plik główny. :"+data['master_file']) + ''' if data['procs'] and data['nodes']: self.add_error(None, u"Zdefiniuj tylko jedno z pól: liczbę procesów lub topologię węzłów") diff --git a/qcg/templates/qcg/job_submit.html b/qcg/templates/qcg/job_submit.html index 0afb982..6a712a9 100644 --- a/qcg/templates/qcg/job_submit.html +++ b/qcg/templates/qcg/job_submit.html @@ -97,7 +97,6 @@ }); $('#id_modules,#id_hosts,#id_pdb_file,#id_master_file,#id_executable,#id_input,#id_stage_in,#id_preprocess_script,#id_postprocess_script').selectize({ - plugins: ['remove_button'] }); diff --git a/qcg/templates/qcg/job_submit_form.html b/qcg/templates/qcg/job_submit_form.html index ffbf92f..69ad5c8 100644 --- a/qcg/templates/qcg/job_submit_form.html +++ b/qcg/templates/qcg/job_submit_form.html @@ -24,16 +24,14 @@ {% bootstrap_field form.retmin layout="horizontal" form_group_class="form-group collapse" %} {% bootstrap_field form.retmax layout="horizontal" form_group_class="form-group collapse" %} - - {% bootstrap_field form.application layout="horizontal" %} - {% bootstrap_field form.master_file layout="horizontal" %} -