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)
- host = forms.ChoiceField(label=u"Host", choices=Host.CHOICES, required=False)
+ host = forms.MultipleChoiceField(label=u"Host", choices=Host.CHOICES, required=False)
properties = forms.MultipleChoiceField(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)
{% block extra_css %}
<link href="{% static 'qcg/selectize/selectize.bootstrap3.css' %}" rel="stylesheet">
- <link href="{% static 'qcg/datetimepicker/bootstrap-datetimepicker.min.css' %}" rel="stylesheet">
{% endblock %}
{% block extra_js %}
<script src="{% static 'qcg/selectize/selectize.min.js' %}"></script>
<script src="{% static 'qcg/formset/jquery.formset.js' %}"></script>
- <script src="{% static 'qcg/moment/moment.min.js' %}"></script>
- <script src="{% static 'qcg/moment/pl.js' %}"></script>
- <script src="{% static 'qcg/datetimepicker/bootstrap-datetimepicker.min.js' %}"></script>
<script>
$(function() {
- $('#id_application, #id_host').selectize();
+ $('#id_application').selectize();
$('#id_arguments,#id_properties,#id_native').selectize({
plugins: ['remove_button'],
create: true,
}
}
});
- $('#id_modules').selectize({
+ $('#id_modules, #id_host').selectize({
plugins: ['remove_button']
});
deleteCssClass: 'delete-btn btn btn-xs btn-danger'
});
- $('#id_not_before,#id_not_after').datetimepicker({
- locale: 'pl',
- minDate: moment()
- });
-
$('input[name="notify_type"],input[name="watch_output_type"],input[name="preprocess_type"],input[name="postprocess_type"]').on('change', function () {
$(this).tab('show');
}).each(function() {
application = form.cleaned_data['application']
if '/' in application:
- app, ver = application.split('1', 1)
- desc.application.set_name(app)
- desc.application.set_version(ver)
+ app_tuple = application.split('/', 1)
else:
- desc.application.set_name(application)
+ app_tuple = (application, None)
+ desc.application = app_tuple
# TODO script
# TODO executable
desc.arguments = form.cleaned_data['arguments']
desc.note = form.cleaned_data['note']
desc.grant = form.cleaned_data['grant']
- desc.host_candidates = [(form.cleaned_data['host'], 'type?')] # FIXME WTF ?!?
+ desc.hosts = form.cleaned_data['host']
desc.properties = form.cleaned_data['properties']
# TODO queue
# TODO procs
# TODO nodes
- desc.wall_time = timedelta(seconds=form.cleaned_data['wall_time']) # FIXME odpowiedni typ pola
+ if form.cleaned_data['wall_time'] is not None:
+ desc.wall_time = form.cleaned_data['wall_time']
desc.memory = form.cleaned_data['memory']
desc.memory_per_slot = form.cleaned_data['memory_per_slot']
- desc.variable = [(env['name'], env['value']) for env in env_formset.cleaned_data if not env['DELETE']]
+ desc.env_variables = [(env['name'], env['value']) for env in env_formset.cleaned_data if not env['DELETE']]
desc.modules = form.cleaned_data['modules']
desc.natives = form.cleaned_data['native']
desc.reservation = ("LOCAL", form.cleaned_data['reservation'])
# TODO postprocess_script
desc.persistent = form.cleaned_data['persistent']
- for prop in ('arguments', 'note', 'grant', 'host_candidates', 'wall_time', 'memory',
- 'memory_per_slot', 'properties', 'variable', 'modules', 'natives', 'persistent', 'reservation'):
+ for prop in ('application', 'arguments', 'note', 'grant', 'hosts', 'wall_time', 'memory', 'memory_per_slot',
+ 'properties', 'env_variables', 'modules', 'natives', 'persistent', 'reservation'):
print prop, type(getattr(desc, prop)), repr(getattr(desc, prop))
print desc.xml_description