Commit 968fbb66 by Kálmán Viktor

network: add verbose_name to fields

parent efd8ef6d
...@@ -33,7 +33,7 @@ class Rule(models.Model): ...@@ -33,7 +33,7 @@ class Rule(models.Model):
blank=False, verbose_name=_("direction"), blank=False, verbose_name=_("direction"),
help_text=_("If the rule matches egress " help_text=_("If the rule matches egress "
"or ingress packets.")) "or ingress packets."))
description = models.TextField(blank=True, description = models.TextField(blank=True, verbose_name=_('description'),
help_text=_("Why is the rule needed, " help_text=_("Why is the rule needed, "
"or how does it work.")) "or how does it work."))
foreign_network = models.ForeignKey( foreign_network = models.ForeignKey(
...@@ -572,19 +572,23 @@ class Host(models.Model): ...@@ -572,19 +572,23 @@ class Host(models.Model):
class Firewall(models.Model): class Firewall(models.Model):
name = models.CharField(max_length=20, unique=True) name = models.CharField(max_length=20, unique=True,
verbose_name=_('name'))
def __unicode__(self): def __unicode__(self):
return self.name return self.name
class Domain(models.Model): class Domain(models.Model):
name = models.CharField(max_length=40, validators=[val_domain]) name = models.CharField(max_length=40, validators=[val_domain],
owner = models.ForeignKey(User) verbose_name=_('name'))
created_at = models.DateTimeField(auto_now_add=True) owner = models.ForeignKey(User, verbose_name=_('owner'))
modified_at = models.DateTimeField(auto_now=True) created_at = models.DateTimeField(auto_now_add=True,
ttl = models.IntegerField(default=600) verbose_name=_('created_at'))
description = models.TextField(blank=True) modified_at = models.DateTimeField(auto_now=True,
verbose_name=_('modified_at'))
ttl = models.IntegerField(default=600, verbose_name=_('ttl'))
description = models.TextField(blank=True, verbose_name=_('description'))
def __unicode__(self): def __unicode__(self):
return self.name return self.name
...@@ -598,16 +602,21 @@ class Record(models.Model): ...@@ -598,16 +602,21 @@ class Record(models.Model):
CHOICES_type = (('A', 'A'), ('CNAME', 'CNAME'), ('AAAA', 'AAAA'), CHOICES_type = (('A', 'A'), ('CNAME', 'CNAME'), ('AAAA', 'AAAA'),
('MX', 'MX'), ('NS', 'NS'), ('PTR', 'PTR'), ('TXT', 'TXT')) ('MX', 'MX'), ('NS', 'NS'), ('PTR', 'PTR'), ('TXT', 'TXT'))
name = models.CharField(max_length=40, validators=[val_domain], name = models.CharField(max_length=40, validators=[val_domain],
blank=True, null=True) blank=True, null=True, verbose_name=_('name'))
domain = models.ForeignKey('Domain') domain = models.ForeignKey('Domain', verbose_name=_('domain'))
host = models.ForeignKey('Host', blank=True, null=True) host = models.ForeignKey('Host', blank=True, null=True,
type = models.CharField(max_length=6, choices=CHOICES_type) verbose_name=_('host'))
address = models.CharField(max_length=40, blank=True, null=True) type = models.CharField(max_length=6, choices=CHOICES_type,
ttl = models.IntegerField(default=600) verbose_name=_('type'))
owner = models.ForeignKey(User) address = models.CharField(max_length=40, blank=True, null=True,
description = models.TextField(blank=True) verbose_name=_('address'))
created_at = models.DateTimeField(auto_now_add=True) ttl = models.IntegerField(default=600, verbose_name=_('ttl'))
modified_at = models.DateTimeField(auto_now=True) owner = models.ForeignKey(User, verbose_name=_('owner'))
description = models.TextField(blank=True, verbose_name=_('description'))
created_at = models.DateTimeField(auto_now_add=True,
verbose_name=_('created_at'))
modified_at = models.DateTimeField(auto_now=True,
verbose_name=_('modified_at'))
def __unicode__(self): def __unicode__(self):
return self.desc() return self.desc()
...@@ -717,15 +726,21 @@ class Blacklist(models.Model): ...@@ -717,15 +726,21 @@ class Blacklist(models.Model):
CHOICES_type = (('permban', 'permanent ban'), ('tempban', 'temporary ban'), CHOICES_type = (('permban', 'permanent ban'), ('tempban', 'temporary ban'),
('whitelist', 'whitelist'), ('tempwhite', 'tempwhite')) ('whitelist', 'whitelist'), ('tempwhite', 'tempwhite'))
ipv4 = models.GenericIPAddressField(protocol='ipv4', unique=True) ipv4 = models.GenericIPAddressField(protocol='ipv4', unique=True)
host = models.ForeignKey('Host', blank=True, null=True) host = models.ForeignKey('Host', blank=True, null=True,
reason = models.TextField(blank=True) verbose_name=_('host'))
snort_message = models.TextField(blank=True) reason = models.TextField(blank=True, verbose_name=_('reason'))
snort_message = models.TextField(blank=True,
verbose_name=_('short message'))
type = models.CharField( type = models.CharField(
max_length=10, max_length=10,
choices=CHOICES_type, choices=CHOICES_type,
default='tempban') default='tempban',
created_at = models.DateTimeField(auto_now_add=True) verbose_name=_('type')
modified_at = models.DateTimeField(auto_now=True) )
created_at = models.DateTimeField(auto_now_add=True,
verbose_name=_('created_at'))
modified_at = models.DateTimeField(auto_now=True,
verbose_name=_('modified_at'))
def save(self, *args, **kwargs): def save(self, *args, **kwargs):
self.full_clean() self.full_clean()
......
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