Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gyuricska Milán
/
cloud
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
2264b2fe
authored
Aug 27, 2013
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
network: record list to domain edit
parent
52aa7931
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
2 deletions
+26
-2
network/tables.py
+12
-0
network/templates/network/domain-edit.html
+8
-1
network/views.py
+6
-1
No files found.
network/tables.py
View file @
2264b2fe
...
@@ -100,6 +100,18 @@ class RecordTable(Table):
...
@@ -100,6 +100,18 @@ class RecordTable(Table):
order_by
=
'name'
order_by
=
'name'
class
SmallRecordTable
(
Table
):
fqdn
=
LinkColumn
(
'network.record'
,
args
=
[
A
(
'pk'
)],
orderable
=
False
)
class
Meta
:
model
=
Record
attrs
=
{
'class'
:
'table table-striped table-bordered'
}
fields
=
(
'type'
,
'fqdn'
,
'host'
,
'address'
,
)
sequence
=
(
'type'
,
'fqdn'
,
)
order_by
=
'-type'
orderable
=
False
class
RuleTable
(
Table
):
class
RuleTable
(
Table
):
r_type
=
LinkColumn
(
'network.rule'
,
args
=
[
A
(
'pk'
)])
r_type
=
LinkColumn
(
'network.rule'
,
args
=
[
A
(
'pk'
)])
color_desc
=
TemplateColumn
(
color_desc
=
TemplateColumn
(
...
...
network/templates/network/domain-edit.html
View file @
2264b2fe
...
@@ -12,8 +12,15 @@
...
@@ -12,8 +12,15 @@
</div>
</div>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-sm-
4
"
>
<div
class=
"col-sm-
5
"
>
{% crispy form %}
{% crispy form %}
</div>
</div>
<div
class=
"col-sm-5 col-sm-offset-1"
>
<h3>
List of this domain's records
</h3>
<hr
/>
{% render_table record_list %}
</div>
</div>
</div>
{% endblock %}
{% endblock %}
network/views.py
View file @
2264b2fe
...
@@ -10,7 +10,8 @@ from firewall.models import (Host, Vlan, Domain, Group, Record, Blacklist,
...
@@ -10,7 +10,8 @@ from firewall.models import (Host, Vlan, Domain, Group, Record, Blacklist,
Rule
,
VlanGroup
)
Rule
,
VlanGroup
)
from
.tables
import
(
HostTable
,
VlanTable
,
SmallHostTable
,
DomainTable
,
from
.tables
import
(
HostTable
,
VlanTable
,
SmallHostTable
,
DomainTable
,
GroupTable
,
RecordTable
,
BlacklistTable
,
RuleTable
,
GroupTable
,
RecordTable
,
BlacklistTable
,
RuleTable
,
VlanGroupTable
,
SmallRuleTable
,
SmallGroupRuleTable
)
VlanGroupTable
,
SmallRuleTable
,
SmallGroupRuleTable
,
SmallRecordTable
)
from
.forms
import
(
HostForm
,
VlanForm
,
DomainForm
,
GroupForm
,
RecordForm
,
from
.forms
import
(
HostForm
,
VlanForm
,
DomainForm
,
GroupForm
,
RecordForm
,
BlacklistForm
,
RuleForm
,
VlanGroupForm
)
BlacklistForm
,
RuleForm
,
VlanGroupForm
)
...
@@ -123,6 +124,10 @@ class DomainDetail(UpdateView):
...
@@ -123,6 +124,10 @@ class DomainDetail(UpdateView):
def
get_context_data
(
self
,
*
args
,
**
kwargs
):
def
get_context_data
(
self
,
*
args
,
**
kwargs
):
context
=
super
(
DomainDetail
,
self
)
.
get_context_data
(
**
kwargs
)
context
=
super
(
DomainDetail
,
self
)
.
get_context_data
(
**
kwargs
)
context
[
'domain_pk'
]
=
self
.
get_object
()
.
pk
context
[
'domain_pk'
]
=
self
.
get_object
()
.
pk
# records
q
=
Record
.
objects
.
filter
(
domain
=
self
.
get_object
())
.
all
()
context
[
'record_list'
]
=
SmallRecordTable
(
q
)
return
context
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