Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
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
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):
)
name
=
TemplateColumn
(
template_name
=
"dashboard/node-list/column-name.html"
template_name
=
"dashboard/node-list/column-name.html"
,
order_by
=
"normalized_name"
)
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
from
model_utils.models
import
TimeStampedModel
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
..tasks
import
vm_tasks
from
.common
import
Trait
...
...
@@ -43,6 +43,7 @@ class Node(TimeStampedModel):
name
=
CharField
(
max_length
=
50
,
unique
=
True
,
verbose_name
=
_
(
'name'
),
help_text
=
_
(
'Human readable name of node.'
))
normalized_name
=
HumanSortField
(
monitor
=
'name'
,
max_length
=
100
)
priority
=
IntegerField
(
verbose_name
=
_
(
'priority'
),
help_text
=
_
(
'Node usage priority.'
))
host
=
ForeignKey
(
Host
,
verbose_name
=
_
(
'host'
),
...
...
@@ -62,6 +63,7 @@ class Node(TimeStampedModel):
app_label
=
'vm'
db_table
=
'vm_node'
permissions
=
()
ordering
=
(
'-enabled'
,
'normalized_name'
)
def
__unicode__
(
self
):
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