Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
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
ff72e3a6
authored
Jan 29, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
network: only show active instances hosts and records in side table
parent
04eae09e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
circle/network/views.py
+16
-5
No files found.
circle/network/views.py
View file @
ff72e3a6
...
...
@@ -8,6 +8,7 @@ from django_tables2 import SingleTableView
from
firewall.models
import
(
Host
,
Vlan
,
Domain
,
Group
,
Record
,
Blacklist
,
Rule
,
VlanGroup
,
SwitchPort
,
EthernetDevice
)
from
vm.models
import
Interface
from
.tables
import
(
HostTable
,
VlanTable
,
SmallHostTable
,
DomainTable
,
GroupTable
,
RecordTable
,
BlacklistTable
,
RuleTable
,
VlanGroupTable
,
SmallRuleTable
,
SmallGroupRuleTable
,
...
...
@@ -149,10 +150,16 @@ class DomainDetail(UpdateView, SuccessMessageMixin):
def
get_context_data
(
self
,
*
args
,
**
kwargs
):
context
=
super
(
DomainDetail
,
self
)
.
get_context_data
(
**
kwargs
)
context
[
'domain_pk'
]
=
self
.
get_object
()
.
pk
# records
q
=
Record
.
objects
.
filter
(
domain
=
self
.
get_object
())
.
all
()
self
.
object
=
self
.
get_object
()
context
[
'domain_pk'
]
=
self
.
object
.
pk
q
=
Record
.
objects
.
filter
(
domain
=
self
.
object
,
host__in
=
Host
.
objects
.
filter
(
interface__in
=
Interface
.
objects
.
filter
(
instance__destroyed
=
None
)
)
)
context
[
'record_list'
]
=
SmallRecordTable
(
q
)
return
context
...
...
@@ -591,7 +598,11 @@ class VlanDetail(UpdateView, SuccessMessageMixin):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
VlanDetail
,
self
)
.
get_context_data
(
**
kwargs
)
q
=
Host
.
objects
.
filter
(
vlan
=
self
.
object
)
.
all
()
q
=
Host
.
objects
.
filter
(
interface__in
=
Interface
.
objects
.
filter
(
vlan
=
self
.
object
,
instance__destroyed
=
None
))
context
[
'host_list'
]
=
SmallHostTable
(
q
)
context
[
'vlan_vid'
]
=
self
.
kwargs
.
get
(
'vid'
)
return
context
...
...
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