@@ -194,14 +194,16 @@ class Interface(models.Model):
description = models.TextField(blank=True, default='Main network interface.')
entity = models.ForeignKey(Entity)
address = models.IPAddressField()
netmask = models.IPAddressField(default='255.255.255.255')
class Meta:
# Enforce uniqueness of interface name in an entity.
unique_together = ("name", "entity")
# Enforce uniqueness of interface name in an entity. Enforce uniqueness
# of IP address in a subnet for an entity.
unique_together = (("name", "entity"),
("entity", "address", "netmask"),)
def __unicode__(self):
"""
Returns:
String representation of an interface. In case of single IP this will
simply be the interface name and IP address. In case of subnet it will