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
19bd2854
authored
Mar 19, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: set natural ordering for nodes
parent
fec342df
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
2 deletions
+5
-2
circle/dashboard/tables.py
+2
-1
circle/vm/migrations/0021_auto__add_field_node_normalized_name.py
+0
-0
circle/vm/models/node.py
+3
-1
No files found.
circle/dashboard/tables.py
View file @
19bd2854
...
@@ -66,7 +66,8 @@ class NodeListTable(Table):
...
@@ -66,7 +66,8 @@ class NodeListTable(Table):
)
)
name
=
TemplateColumn
(
name
=
TemplateColumn
(
template_name
=
"dashboard/node-list/column-name.html"
template_name
=
"dashboard/node-list/column-name.html"
,
order_by
=
"normalized_name"
)
)
priority
=
Column
(
priority
=
Column
(
...
...
circle/vm/migrations/0021_auto__add_field_node_normalized_name.py
0 → 100644
View file @
19bd2854
This diff is collapsed.
Click to expand it.
circle/vm/models/node.py
View file @
19bd2854
...
@@ -11,7 +11,7 @@ from celery.exceptions import TimeoutError
...
@@ -11,7 +11,7 @@ from celery.exceptions import TimeoutError
from
model_utils.models
import
TimeStampedModel
from
model_utils.models
import
TimeStampedModel
from
taggit.managers
import
TaggableManager
from
taggit.managers
import
TaggableManager
from
common.models
import
method_cache
,
WorkerNotFound
from
common.models
import
method_cache
,
WorkerNotFound
,
HumanSortField
from
firewall.models
import
Host
from
firewall.models
import
Host
from
..tasks
import
vm_tasks
from
..tasks
import
vm_tasks
from
.common
import
Trait
from
.common
import
Trait
...
@@ -43,6 +43,7 @@ class Node(TimeStampedModel):
...
@@ -43,6 +43,7 @@ class Node(TimeStampedModel):
name
=
CharField
(
max_length
=
50
,
unique
=
True
,
name
=
CharField
(
max_length
=
50
,
unique
=
True
,
verbose_name
=
_
(
'name'
),
verbose_name
=
_
(
'name'
),
help_text
=
_
(
'Human readable name of node.'
))
help_text
=
_
(
'Human readable name of node.'
))
normalized_name
=
HumanSortField
(
monitor
=
'name'
,
max_length
=
100
)
priority
=
IntegerField
(
verbose_name
=
_
(
'priority'
),
priority
=
IntegerField
(
verbose_name
=
_
(
'priority'
),
help_text
=
_
(
'Node usage priority.'
))
help_text
=
_
(
'Node usage priority.'
))
host
=
ForeignKey
(
Host
,
verbose_name
=
_
(
'host'
),
host
=
ForeignKey
(
Host
,
verbose_name
=
_
(
'host'
),
...
@@ -62,6 +63,7 @@ class Node(TimeStampedModel):
...
@@ -62,6 +63,7 @@ class Node(TimeStampedModel):
app_label
=
'vm'
app_label
=
'vm'
db_table
=
'vm_node'
db_table
=
'vm_node'
permissions
=
()
permissions
=
()
ordering
=
(
'-enabled'
,
'normalized_name'
)
def
__unicode__
(
self
):
def
__unicode__
(
self
):
return
self
.
name
return
self
.
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