Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
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):
...
@@ -95,10 +95,10 @@ class VmSaveForm(OperationForm):
if
default
:
if
default
:
self
.
fields
[
'name'
]
.
initial
=
default
self
.
fields
[
'name'
]
.
initial
=
default
if
clone
:
if
clone
:
self
.
fields
.
insert
(
2
,
"clone"
,
forms
.
BooleanField
(
self
.
fields
[
"clone"
]
=
forms
.
BooleanField
(
required
=
False
,
label
=
_
(
"Clone template permissions"
),
required
=
False
,
label
=
_
(
"Clone template permissions"
),
help_text
=
_
(
"Clone the access list of parent template. Useful "
help_text
=
_
(
"Clone the access list of parent template. Useful "
"for updating a template."
))
)
"for updating a template."
))
class
VmCustomizeForm
(
forms
.
Form
):
class
VmCustomizeForm
(
forms
.
Form
):
...
@@ -749,9 +749,9 @@ class VmRenewForm(OperationForm):
...
@@ -749,9 +749,9 @@ class VmRenewForm(OperationForm):
default
=
kwargs
.
pop
(
'default'
)
default
=
kwargs
.
pop
(
'default'
)
super
(
VmRenewForm
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
super
(
VmRenewForm
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
self
.
fields
.
insert
(
0
,
'lease'
,
forms
.
ModelChoiceField
(
self
.
fields
[
'lease'
]
=
forms
.
ModelChoiceField
(
queryset
=
choices
,
initial
=
default
,
required
=
False
,
queryset
=
choices
,
initial
=
default
,
required
=
False
,
empty_label
=
None
,
label
=
_
(
'Length'
))
)
empty_label
=
None
,
label
=
_
(
'Length'
))
if
len
(
choices
)
<
2
:
if
len
(
choices
)
<
2
:
self
.
fields
[
'lease'
]
.
widget
=
HiddenInput
()
self
.
fields
[
'lease'
]
.
widget
=
HiddenInput
()
self
.
fields
[
'save'
]
.
widget
=
HiddenInput
()
self
.
fields
[
'save'
]
.
widget
=
HiddenInput
()
...
@@ -771,9 +771,9 @@ class VmMigrateForm(forms.Form):
...
@@ -771,9 +771,9 @@ class VmMigrateForm(forms.Form):
default
=
kwargs
.
pop
(
'default'
)
default
=
kwargs
.
pop
(
'default'
)
super
(
VmMigrateForm
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
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
,
queryset
=
choices
,
initial
=
default
,
required
=
False
,
widget
=
forms
.
RadioSelect
(),
label
=
_
(
"Node"
))
)
widget
=
forms
.
RadioSelect
(),
label
=
_
(
"Node"
))
class
VmStateChangeForm
(
OperationForm
):
class
VmStateChangeForm
(
OperationForm
):
...
@@ -834,9 +834,9 @@ class VmDiskResizeForm(OperationForm):
...
@@ -834,9 +834,9 @@ class VmDiskResizeForm(OperationForm):
super
(
VmDiskResizeForm
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
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
,
queryset
=
choices
,
initial
=
self
.
disk
,
required
=
True
,
empty_label
=
None
,
label
=
_
(
'Disk'
))
)
empty_label
=
None
,
label
=
_
(
'Disk'
))
if
self
.
disk
:
if
self
.
disk
:
self
.
fields
[
'disk'
]
.
widget
=
HiddenInput
()
self
.
fields
[
'disk'
]
.
widget
=
HiddenInput
()
self
.
fields
[
'size'
]
.
initial
+=
self
.
disk
.
size
self
.
fields
[
'size'
]
.
initial
+=
self
.
disk
.
size
...
@@ -870,9 +870,9 @@ class VmDiskRemoveForm(OperationForm):
...
@@ -870,9 +870,9 @@ class VmDiskRemoveForm(OperationForm):
super
(
VmDiskRemoveForm
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
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
,
queryset
=
choices
,
initial
=
self
.
disk
,
required
=
True
,
empty_label
=
None
,
label
=
_
(
'Disk'
))
)
empty_label
=
None
,
label
=
_
(
'Disk'
))
if
self
.
disk
:
if
self
.
disk
:
self
.
fields
[
'disk'
]
.
widget
=
HiddenInput
()
self
.
fields
[
'disk'
]
.
widget
=
HiddenInput
()
...
@@ -915,9 +915,9 @@ class VmRemoveInterfaceForm(OperationForm):
...
@@ -915,9 +915,9 @@ class VmRemoveInterfaceForm(OperationForm):
super
(
VmRemoveInterfaceForm
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
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
,
queryset
=
choices
,
initial
=
self
.
interface
,
required
=
True
,
empty_label
=
None
,
label
=
_
(
'Interface'
))
)
empty_label
=
None
,
label
=
_
(
'Interface'
))
if
self
.
interface
:
if
self
.
interface
:
self
.
fields
[
'interface'
]
.
widget
=
HiddenInput
()
self
.
fields
[
'interface'
]
.
widget
=
HiddenInput
()
...
@@ -959,10 +959,10 @@ class VmDeployForm(OperationForm):
...
@@ -959,10 +959,10 @@ class VmDeployForm(OperationForm):
super
(
VmDeployForm
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
super
(
VmDeployForm
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
if
choices
is
not
None
:
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
=
_
(
queryset
=
choices
,
required
=
False
,
label
=
_
(
'Node'
),
help_text
=
_
(
"Deploy virtual machine to this node "
"Deploy virtual machine to this node "
"(blank allows scheduling automatically)."
))
)
"(blank allows scheduling automatically)."
))
class
VmPortRemoveForm
(
OperationForm
):
class
VmPortRemoveForm
(
OperationForm
):
...
@@ -972,9 +972,9 @@ class VmPortRemoveForm(OperationForm):
...
@@ -972,9 +972,9 @@ class VmPortRemoveForm(OperationForm):
super
(
VmPortRemoveForm
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
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
,
queryset
=
choices
,
initial
=
self
.
rule
,
required
=
True
,
empty_label
=
None
,
label
=
_
(
'Port'
))
)
empty_label
=
None
,
label
=
_
(
'Port'
))
if
self
.
rule
:
if
self
.
rule
:
self
.
fields
[
'rule'
]
.
widget
=
HiddenInput
()
self
.
fields
[
'rule'
]
.
widget
=
HiddenInput
()
...
@@ -991,9 +991,9 @@ class VmPortAddForm(OperationForm):
...
@@ -991,9 +991,9 @@ class VmPortAddForm(OperationForm):
super
(
VmPortAddForm
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
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
,
queryset
=
choices
,
initial
=
self
.
host
,
required
=
True
,
empty_label
=
None
,
label
=
_
(
'Host'
))
)
empty_label
=
None
,
label
=
_
(
'Host'
))
if
self
.
host
:
if
self
.
host
:
self
.
fields
[
'host'
]
.
widget
=
HiddenInput
()
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