X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?a=blobdiff_plain;f=qcg%2Fforms.py;h=7b11d13a33771d1a27cb7f2c255aab8e73e2409a;hb=acdd4e574dd1ec6f3b901cbdaefb2c155f09bbf5;hp=177132797eb270d805dd6380ef309704e61ec2d7;hpb=c7aa0d764b0b5a6bcd7df967f317bf9fbcde8f73;p=qcg-portal.git diff --git a/qcg/forms.py b/qcg/forms.py index 1771327..7b11d13 100644 --- a/qcg/forms.py +++ b/qcg/forms.py @@ -4,7 +4,7 @@ from django.core.validators import RegexValidator from django.template.defaultfilters import capfirst from pyqcg.utils import TaskStatus -from qcg.fields import PredefinedChoiceField, MultiplePredefinedChoiceField +from qcg.fields import PredefinedChoiceField, MultiplePredefinedChoiceField, TimeRangeField from qcg.models import Task, Allocation @@ -120,7 +120,7 @@ class JobDescriptionForm(forms.Form): queue = PredefinedChoiceField(choices=QUEUE_CHOICES, label=u"Kolejka", required=False) procs = forms.IntegerField(label=u"Liczba procesów", min_value=0, required=False) nodes = forms.CharField(label=u"Topologia węzłów", max_length=10, validators=[nodes_validator], required=False) - wall_time = forms.IntegerField(label=u"Wall time (s)", min_value=0, required=False) # TODO duration field + 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) @@ -136,7 +136,7 @@ class JobDescriptionForm(forms.Form): not_after = forms.DateTimeField(label=u"Nie później niż", required=False) not_before = forms.DateTimeField(label=u"Nie wcześniej niż", required=False) - deadline = forms.IntegerField(label=u"Deadline (s)", min_value=0, required=False) # TODO duration field + deadline = TimeRangeField(label=u"Deadline", required=False) reservation = forms.CharField(label=u"Rezerwacja", max_length=100, required=False) monitoring = forms.BooleanField(label=u"Portal QCG-Monitoring", required=False) @@ -169,3 +169,19 @@ class EnvForm(forms.Form): EnvFormSet = forms.formset_factory(EnvForm, can_delete=True, extra=0) + + +class ColumnsForm(forms.Form): + JOB_ID, DESCRIPTION, SUBMISSION, START, END, STATUS, HOST = range(7) + COLUMNS_CHOICES = ( + (JOB_ID, u"Identyfikator zadania"), + (DESCRIPTION, u"Opis"), + (SUBMISSION, u"Wysłane"), + (START, u"Start"), + (END, u"Koniec"), + (STATUS, u"Status"), + (HOST, u"Host"), + ) + + columns = forms.MultipleChoiceField(choices=COLUMNS_CHOICES, label=u"Kolumny", required=False, + widget=forms.CheckboxSelectMultiple)