add GenericRelation for ipam.IPAddressFunction

This commit is contained in:
Jamie Murphy 2023-07-05 16:58:11 +01:00
parent 3c82920870
commit 1167a0473e
2 changed files with 11 additions and 0 deletions

View File

@ -645,6 +645,9 @@ class Device(PrimaryModel, ConfigContextModel):
images = GenericRelation(
to='extras.ImageAttachment'
)
ipaddressfunctions = GenericRelation(
to='ipam.IPAddressFunction'
)
objects = ConfigContextModelQuerySet.as_manager()
@ -1231,6 +1234,11 @@ class VirtualDeviceContext(PrimaryModel):
blank=True
)
# Generic relation
ipaddressfunctions = GenericRelation(
to='ipam.IPAddressFunction'
)
class Meta:
ordering = ['name']
constraints = (

View File

@ -124,6 +124,9 @@ class VirtualMachine(PrimaryModel, ConfigContextModel):
contacts = GenericRelation(
to='tenancy.ContactAssignment'
)
ipaddressfunctions = GenericRelation(
to='ipam.IPAddressFunction'
)
objects = ConfigContextModelQuerySet.as_manager()