Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
allgo
allgo
Commits
2d573a20
Commit
2d573a20
authored
Sep 19, 2018
by
BAIRE Anthony
Browse files
allow changing the job queue in WebappUpdate
parent
033ae7a2
Changes
2
Hide whitespace changes
Inline
Side-by-side
django/allgo/main/forms.py
View file @
2d573a20
...
...
@@ -59,6 +59,10 @@ class UserWebappForm(forms.ModelForm):
tags
=
TagField
(
label_suffix
=
''
)
memory_limit_mb
=
forms
.
IntegerField
(
label
=
"Memory limit"
,
label_suffix
=
''
,
min_value
=
0
)
job_queue
=
forms
.
ModelChoiceField
(
queryset
=
JobQueue
.
objects
.
all
().
distinct
().
order_by
(
"timeout"
),
label
=
'Default job queue'
,
label_suffix
=
''
)
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
().
__init__
(
*
args
,
**
kwargs
)
...
...
@@ -79,7 +83,8 @@ class UserWebappForm(forms.ModelForm):
class
Meta
:
model
=
Webapp
fields
=
(
'name'
,
'description'
,
'contact'
,
'notebook_gitrepo'
,
'private'
,
'owner'
,
'docker_os'
,
'tags'
,
'entrypoint'
)
'private'
,
'owner'
,
'docker_os'
,
'tags'
,
'entrypoint'
,
'job_queue'
)
class
HomeSignupForm
(
SignupForm
):
...
...
django/allgo/templates/webapp_update.html
View file @
2d573a20
{% extends "base.html" %}
{% load i18n static htmlattrs %}
{% load i18n static htmlattrs
converters
%}
{% block title %}Update your webapp{% endblock %}
...
...
@@ -67,6 +67,18 @@
{{ form.notebook_gitrepo.label_tag }}
{{ form.notebook_gitrepo | attr:"placeholder:https://example.tld/repo.git" | add_class:"form-control" }}
</div>
<div
class=
"form-group"
>
{{ form.job_queue.label_tag }}
<select
name=
"{{ form.job_queue.name }}"
id=
"{{ form.job_queue.id_for_label }}"
class=
"form-control"
>
{% for choice in form.job_queue.field.queryset %}
<option
value=
"{{ choice.pk }}"
{%
if
choice.pk =
=
form.instance.job_queue_id
%}
selected
{%
endif
%}
>
{{ choice | fancy_job_queue }}
</option>
{% endfor %}
</select>
</div>
<div
class=
"form-group"
>
<div
class=
"form-check"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment