Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2972e5cb
authored
Mar 03, 2014
by
Oláh István Gergely
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: add traitform
parent
325d19ca
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletions
+21
-1
circle/dashboard/forms.py
+21
-1
No files found.
circle/dashboard/forms.py
View file @
2972e5cb
...
...
@@ -17,7 +17,9 @@ from sizefield.widgets import FileSizeWidget
from
firewall.models
import
Vlan
,
Host
from
storage.models
import
Disk
,
DataStore
from
vm.models
import
InstanceTemplate
,
Lease
,
InterfaceTemplate
,
Node
from
vm.models
import
(
InstanceTemplate
,
Lease
,
InterfaceTemplate
,
Node
,
Trait
,
)
VLANS
=
Vlan
.
objects
.
all
()
DISKS
=
Disk
.
objects
.
exclude
(
type
=
"qcow2-snap"
)
...
...
@@ -803,3 +805,21 @@ class WorkingBaseInput(BaseInput):
self
.
input_type
=
input_type
self
.
field_classes
=
""
# we need this for some reason
super
(
WorkingBaseInput
,
self
)
.
__init__
(
name
,
value
,
**
kwargs
)
class
TraitForm
(
forms
.
ModelForm
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
(
TraitForm
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
self
.
helper
=
FormHelper
(
self
)
self
.
helper
.
form_show_labels
=
False
self
.
helper
.
layout
=
Layout
(
Div
(
'name'
,
css_class
=
"col-sm-2"
,
),
)
class
Meta
:
model
=
Trait
fields
=
[
'name'
]
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