Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
aed286e6
authored
Jan 15, 2015
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: migrate form fields
parent
37c1c52d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
circle/dashboard/forms.py
+18
-18
No files found.
circle/dashboard/forms.py
View file @
aed286e6
...
...
@@ -95,10 +95,10 @@ class VmSaveForm(OperationForm):
if
default
:
self
.
fields
[
'name'
]
.
initial
=
default
if
clone
:
self
.
fields
.
insert
(
2
,
"clone"
,
forms
.
BooleanField
(
self
.
fields
[
"clone"
]
=
forms
.
BooleanField
(
required
=
False
,
label
=
_
(
"Clone template permissions"
),
help_text
=
_
(
"Clone the access list of parent template. Useful "
"for updating a template."
))
)
"for updating a template."
))
class
VmCustomizeForm
(
forms
.
Form
):
...
...
@@ -749,9 +749,9 @@ class VmRenewForm(OperationForm):
default
=
kwargs
.
pop
(
'default'
)
super
(
VmRenewForm
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
self
.
fields
.
insert
(
0
,
'lease'
,
forms
.
ModelChoiceField
(
self
.
fields
[
'lease'
]
=
forms
.
ModelChoiceField
(
queryset
=
choices
,
initial
=
default
,
required
=
False
,
empty_label
=
None
,
label
=
_
(
'Length'
))
)
empty_label
=
None
,
label
=
_
(
'Length'
))
if
len
(
choices
)
<
2
:
self
.
fields
[
'lease'
]
.
widget
=
HiddenInput
()
self
.
fields
[
'save'
]
.
widget
=
HiddenInput
()
...
...
@@ -771,9 +771,9 @@ class VmMigrateForm(forms.Form):
default
=
kwargs
.
pop
(
'default'
)
super
(
VmMigrateForm
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
self
.
fields
.
insert
(
0
,
'to_node'
,
forms
.
ModelChoiceField
(
self
.
fields
[
'to_node'
]
=
forms
.
ModelChoiceField
(
queryset
=
choices
,
initial
=
default
,
required
=
False
,
widget
=
forms
.
RadioSelect
(),
label
=
_
(
"Node"
))
)
widget
=
forms
.
RadioSelect
(),
label
=
_
(
"Node"
))
class
VmStateChangeForm
(
OperationForm
):
...
...
@@ -834,9 +834,9 @@ class VmDiskResizeForm(OperationForm):
super
(
VmDiskResizeForm
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
self
.
fields
.
insert
(
0
,
'disk'
,
forms
.
ModelChoiceField
(
self
.
fields
[
'disk'
]
=
forms
.
ModelChoiceField
(
queryset
=
choices
,
initial
=
self
.
disk
,
required
=
True
,
empty_label
=
None
,
label
=
_
(
'Disk'
))
)
empty_label
=
None
,
label
=
_
(
'Disk'
))
if
self
.
disk
:
self
.
fields
[
'disk'
]
.
widget
=
HiddenInput
()
self
.
fields
[
'size'
]
.
initial
+=
self
.
disk
.
size
...
...
@@ -870,9 +870,9 @@ class VmDiskRemoveForm(OperationForm):
super
(
VmDiskRemoveForm
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
self
.
fields
.
insert
(
0
,
'disk'
,
forms
.
ModelChoiceField
(
self
.
fields
[
'disk'
]
=
forms
.
ModelChoiceField
(
queryset
=
choices
,
initial
=
self
.
disk
,
required
=
True
,
empty_label
=
None
,
label
=
_
(
'Disk'
))
)
empty_label
=
None
,
label
=
_
(
'Disk'
))
if
self
.
disk
:
self
.
fields
[
'disk'
]
.
widget
=
HiddenInput
()
...
...
@@ -915,9 +915,9 @@ class VmRemoveInterfaceForm(OperationForm):
super
(
VmRemoveInterfaceForm
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
self
.
fields
.
insert
(
0
,
'interface'
,
forms
.
ModelChoiceField
(
self
.
fields
[
'interface'
]
=
forms
.
ModelChoiceField
(
queryset
=
choices
,
initial
=
self
.
interface
,
required
=
True
,
empty_label
=
None
,
label
=
_
(
'Interface'
))
)
empty_label
=
None
,
label
=
_
(
'Interface'
))
if
self
.
interface
:
self
.
fields
[
'interface'
]
.
widget
=
HiddenInput
()
...
...
@@ -959,10 +959,10 @@ class VmDeployForm(OperationForm):
super
(
VmDeployForm
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
if
choices
is
not
None
:
self
.
fields
.
insert
(
0
,
'node'
,
forms
.
ModelChoiceField
(
self
.
fields
[
'node'
]
=
forms
.
ModelChoiceField
(
queryset
=
choices
,
required
=
False
,
label
=
_
(
'Node'
),
help_text
=
_
(
"Deploy virtual machine to this node "
"(blank allows scheduling automatically)."
))
)
"(blank allows scheduling automatically)."
))
class
VmPortRemoveForm
(
OperationForm
):
...
...
@@ -972,9 +972,9 @@ class VmPortRemoveForm(OperationForm):
super
(
VmPortRemoveForm
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
self
.
fields
.
insert
(
0
,
'rule'
,
forms
.
ModelChoiceField
(
self
.
fields
[
'rule'
]
=
forms
.
ModelChoiceField
(
queryset
=
choices
,
initial
=
self
.
rule
,
required
=
True
,
empty_label
=
None
,
label
=
_
(
'Port'
))
)
empty_label
=
None
,
label
=
_
(
'Port'
))
if
self
.
rule
:
self
.
fields
[
'rule'
]
.
widget
=
HiddenInput
()
...
...
@@ -991,9 +991,9 @@ class VmPortAddForm(OperationForm):
super
(
VmPortAddForm
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
self
.
fields
.
insert
(
0
,
'host'
,
forms
.
ModelChoiceField
(
self
.
fields
[
'host'
]
=
forms
.
ModelChoiceField
(
queryset
=
choices
,
initial
=
self
.
host
,
required
=
True
,
empty_label
=
None
,
label
=
_
(
'Host'
))
)
empty_label
=
None
,
label
=
_
(
'Host'
))
if
self
.
host
:
self
.
fields
[
'host'
]
.
widget
=
HiddenInput
()
...
...
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