Commit 4a0abb1e by Bach Dániel

network: add new fields to blacklisttable

parent 704027af
...@@ -20,7 +20,8 @@ from django.utils.translation import ugettext_lazy as _ ...@@ -20,7 +20,8 @@ from django.utils.translation import ugettext_lazy as _
from django.utils.html import format_html from django.utils.html import format_html
from django_tables2 import Table, A from django_tables2 import Table, A
from django_tables2.columns import LinkColumn, TemplateColumn, Column from django_tables2.columns import (LinkColumn, TemplateColumn, Column,
BooleanColumn)
from firewall.models import Host, Vlan, Domain, Group, Record, Rule, SwitchPort from firewall.models import Host, Vlan, Domain, Group, Record, Rule, SwitchPort
...@@ -41,12 +42,14 @@ class MACColumn(Column): ...@@ -41,12 +42,14 @@ class MACColumn(Column):
class BlacklistItemTable(Table): class BlacklistItemTable(Table):
ipv4 = LinkColumn('network.blacklist', args=[A('pk')]) ipv4 = LinkColumn('network.blacklist', args=[A('pk')])
whitelisted = BooleanColumn()
class Meta: class Meta:
model = Domain model = Domain
attrs = {'class': 'table table-striped table-condensed'} attrs = {'class': 'table table-striped table-condensed'}
fields = ('ipv4', 'host', 'expires_at', 'whitelisted', 'reason') fields = ('ipv4', 'host', 'reason', 'whitelisted', 'expires_at',
order_by = ('ipv4', ) 'created_at')
order_by = ('-expires_at', )
class DomainTable(Table): class DomainTable(Table):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment