From 5725c6d5d3bbd7ad97011b84d6bd4aa9bd6b8ab6 Mon Sep 17 00:00:00 2001 From: Parker Berberian Date: Tue, 4 Feb 2020 16:32:02 -0500 Subject: Updates Interface Models Removes a redundant name field and adds an explicit ForeignKey mapping between Interface and InterfaceProfile Change-Id: I3472ef53b889d8d5557e4f083a15940c2022877d Signed-off-by: Parker Berberian --- src/resource_inventory/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/resource_inventory/models.py b/src/resource_inventory/models.py index d152698..d4b8e83 100644 --- a/src/resource_inventory/models.py +++ b/src/resource_inventory/models.py @@ -429,9 +429,9 @@ class Interface(models.Model): id = models.AutoField(primary_key=True) mac_address = models.CharField(max_length=17) bus_address = models.CharField(max_length=50) - name = models.CharField(max_length=100, default="eth0") config = models.ManyToManyField(Vlan) host = models.ForeignKey(Host, on_delete=models.CASCADE, related_name='interfaces') + profile = models.ForeignKey(InterfaceProfile, on_delete=models.CASCADE) def __str__(self): return self.mac_address + " on host " + str(self.host) -- cgit 1.2.3-korg