mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-21 12:52:21 -06:00
Moves related ips to a tab (#12502)
* moves related ips to a tab #12233 * Refactor IP address templates to use a base template --------- Co-authored-by: jeremystretch <jstretch@netboxlabs.com>
This commit is contained in:
committed by
GitHub
parent
57156f0e94
commit
6b19f15a7b
@@ -783,6 +783,14 @@ class IPAddress(PrimaryModel):
|
||||
if available_ips:
|
||||
return next(iter(available_ips))
|
||||
|
||||
def get_related_ips(self):
|
||||
"""
|
||||
Return all IPAddresses belonging to the same VRF.
|
||||
"""
|
||||
return IPAddress.objects.exclude(address=str(self.address)).filter(
|
||||
vrf=self.vrf, address__net_contained_or_equal=str(self.address)
|
||||
)
|
||||
|
||||
def clean(self):
|
||||
super().clean()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user