wlaczony debuging
[qcg-portal.git] / qcg / forms.py
index 2708c5e..491ad30 100644 (file)
@@ -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")