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'
(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'),
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)
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)
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)