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
df2c02ff
authored
Mar 01, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall: add queryset optimalizations
parent
742b9423
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
circle/firewall/admin.py
+4
-0
circle/network/views.py
+5
-0
No files found.
circle/firewall/admin.py
View file @
df2c02ff
...
@@ -25,6 +25,10 @@ class HostAdmin(admin.ModelAdmin):
...
@@ -25,6 +25,10 @@ class HostAdmin(admin.ModelAdmin):
filter_horizontal
=
(
'groups'
,
)
filter_horizontal
=
(
'groups'
,
)
inlines
=
(
RuleInline
,
RecordInline
)
inlines
=
(
RuleInline
,
RecordInline
)
def
queryset
(
self
,
request
):
qs
=
super
(
HostAdmin
,
self
)
.
queryset
(
request
)
return
qs
.
prefetch_related
(
'groups'
)
@staticmethod
@staticmethod
def
list_groups
(
instance
):
def
list_groups
(
instance
):
"""Returns instance's groups' names as a comma-separated list."""
"""Returns instance's groups' names as a comma-separated list."""
...
...
circle/network/views.py
View file @
df2c02ff
...
@@ -503,6 +503,11 @@ class RuleList(LoginRequiredMixin, SuperuserRequiredMixin, SingleTableView):
...
@@ -503,6 +503,11 @@ class RuleList(LoginRequiredMixin, SuperuserRequiredMixin, SingleTableView):
template_name
=
"network/rule-list.html"
template_name
=
"network/rule-list.html"
table_pagination
=
False
table_pagination
=
False
def
get_table_data
(
self
):
return
Rule
.
objects
.
select_related
(
'host'
,
'hostgroup'
,
'vlan'
,
'vlangroup'
,
'firewall'
,
'foreign_network'
,
'owner'
)
class
RuleDetail
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
class
RuleDetail
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
SuccessMessageMixin
,
UpdateView
):
SuccessMessageMixin
,
UpdateView
):
...
...
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