X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?a=blobdiff_plain;f=qcg%2Fforms.py;h=26f901f0242aaf1b432496999b14c0ddea6741a3;hb=15df4cc114ef44ce5e1fdf95f861226b04b1a788;hp=2798c952a0bb54226d3e1ccb4173859217a8407d;hpb=9f0267486fef6a929c431db5cb76a36e2f93ed54;p=qcg-portal.git diff --git a/qcg/forms.py b/qcg/forms.py index 2798c95..26f901f 100644 --- a/qcg/forms.py +++ b/qcg/forms.py @@ -64,20 +64,6 @@ class FiltersForm(forms.Form): class JobDescriptionForm(forms.Form): - class Host(object): - GALERA = 'galera.task.gda.pl' - HYDRA = 'hydra.icm.edu.pl' - INULA = 'inula.man.poznan.pl' - MOSS = 'moss.man.poznan.pl' - NOVA = 'nova.wcss.wroc.pl' - REEF = 'reef.man.poznan.pl' - ZEUS = 'zeus.cyfronet.pl' - - CHOICES = ( - CHOICES_PLACEHOLDER, - (INULA, u'Inula'), - ) - class Process(object): NONE = '' CMD = 'c' @@ -89,27 +75,28 @@ class JobDescriptionForm(forms.Form): (SCRIPT, u'Skrypt'), ) + APPLICATION_CHOICES = ( CHOICES_PLACEHOLDER, ('unres-gab', 'UNRES GAB'), ('unres-e0ll2y', 'UNRES E0LL2Y'), ) + QUEUE_CHOICES = ( CHOICES_PLACEHOLDER, ('plgrid', 'plgrid'), ('plgrid-long', 'plgrid-long'), ('plgrid-testing', 'plgrid-testing'), ) - MODULES_CHOICES = ( - CHOICES_PLACEHOLDER, - ) + PROTOCOL_CHOICES = ( ('', u'Brak'), ('mailto', u'E-mail'), ('xmpp', u'XMPP'), ) + FORCE_FIELD_CHOICES = ( ('GAB', u'GAB'), ('E0LL2Y', u'E0LL2Y'), @@ -128,15 +115,16 @@ class JobDescriptionForm(forms.Form): sequence = forms.CharField(label=u"Sekwencja", help_text=u"Sekwencja aminokwasów w zapisie jednoliterowym", widget=forms.Textarea(attrs={'rows': 2, 'cols': 40}), required=False) - application = forms.ChoiceField(choices=APPLICATION_CHOICES, label=u"Aplikacja", required=False, initial='unres-gab') # TODO choices + application = forms.ChoiceField(choices=APPLICATION_CHOICES, label=u"Aplikacja", required=False, initial='unres-gab') #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) arguments = forms.MultipleChoiceField(label=u"Argumenty", required=False) note = forms.CharField(label=u"Opis", widget=forms.Textarea(attrs={'rows': 2, 'cols': 40}), required=False) grant = forms.CharField(label=u"Grant", max_length=100, required=False) - hosts = forms.MultipleChoiceField(label=u"Host", choices=Host.CHOICES, required=False) + hosts = forms.MultipleChoiceField(label=u"Host", 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) @@ -144,7 +132,7 @@ class JobDescriptionForm(forms.Form): wall_time = TimeRangeField(label=u"Wall time", required=False) memory = forms.IntegerField(label=u"Pamięć (MB)", min_value=0, required=False) memory_per_slot = forms.IntegerField(label=u"Pamięci per proces (MB)", min_value=0, required=False) - modules = forms.MultipleChoiceField(label=u"Moduły", choices=MODULES_CHOICES, required=False) # TODO choices + modules = forms.MultipleChoiceField(label=u"Moduły", required=False) reservation = forms.CharField(label=u"Rezerwacja", max_length=100, required=False) input = forms.CharField(label=u"Standardowe wejście", max_length=500, required=False) @@ -170,9 +158,13 @@ class JobDescriptionForm(forms.Form): native = forms.MultipleChoiceField(label=u"Opcje systemu kolejkowego", required=False) persistent = forms.BooleanField(label=u"Trwałe", required=False) - def __init__(self, data=None, initial=None, *args, **kwargs): + def __init__(self, data=None, initial=None, hosts=(), applications=(), modules=(), *args, **kwargs): super(JobDescriptionForm, self).__init__(data, initial=initial, *args, **kwargs) + self.fields['hosts'].choices = hosts + self.fields['application'].choices = applications + self.fields['modules'].choices = modules + if data or initial: self._init_user_choices('queue', data, initial) self._init_user_choices('arguments', data, initial)