Converted IPAddress.interface to a GenericForeignKey

This commit is contained in:
Jeremy Stretch
2017-08-18 16:57:20 -04:00
parent 97536c4e9b
commit 5930a64203
9 changed files with 106 additions and 32 deletions

View File

@@ -1175,6 +1175,11 @@ class Interface(models.Model):
help_text="This interface is used only for out-of-band management"
)
description = models.CharField(max_length=100, blank=True)
ip_addresses = GenericRelation(
to='ipam.IPAddress',
content_type_field='interface_type',
object_id_field='interface_id'
)
objects = InterfaceQuerySet.as_manager()