Commit 3eb0db45 by Bach Dániel

firewall: add unique_together = ('hostname', 'vlan')

parent 4ba6d1d8
...@@ -365,7 +365,7 @@ class Host(models.Model): ...@@ -365,7 +365,7 @@ class Host(models.Model):
A host of the network. A host of the network.
""" """
hostname = models.CharField(max_length=40, unique=True, hostname = models.CharField(max_length=40,
verbose_name=_('hostname'), verbose_name=_('hostname'),
help_text=_('The alphanumeric hostname of ' help_text=_('The alphanumeric hostname of '
'the host, the first part of ' 'the host, the first part of '
...@@ -422,6 +422,9 @@ class Host(models.Model): ...@@ -422,6 +422,9 @@ class Host(models.Model):
modified_at = models.DateTimeField(auto_now=True, modified_at = models.DateTimeField(auto_now=True,
verbose_name=_('modified at')) verbose_name=_('modified at'))
class Meta(object):
unique_together = ('hostname', 'vlan')
def __unicode__(self): def __unicode__(self):
return self.hostname return self.hostname
......
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