1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes #6070: Add missing 'count_ipaddresses' attribute to VMInterface serializer

This commit is contained in:
jeremystretch
2021-04-08 14:22:45 -04:00
parent f096c4a5d0
commit e69251b21a
4 changed files with 8 additions and 6 deletions

View File

@@ -478,6 +478,10 @@ class BaseInterface(models.Model):
return super().save(*args, **kwargs)
@property
def count_ipaddresses(self):
return self.ip_addresses.count()
@extras_features('export_templates', 'webhooks', 'custom_links')
class Interface(CableTermination, PathEndpoint, ComponentModel, BaseInterface):
@@ -615,10 +619,6 @@ class Interface(CableTermination, PathEndpoint, ComponentModel, BaseInterface):
def is_lag(self):
return self.type == InterfaceTypeChoices.TYPE_LAG
@property
def count_ipaddresses(self):
return self.ip_addresses.count()
#
# Pass-through ports