From 1452d57f380cc344bd222f055341d01b158699a5 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Thu, 30 Apr 2026 10:49:39 -0400 Subject: [PATCH] Closes #22047: Deprecate ExpandableIPAddressField (#22050) --- netbox/utilities/forms/fields/expandable.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/netbox/utilities/forms/fields/expandable.py b/netbox/utilities/forms/fields/expandable.py index 2bc59c7ad..ea222268e 100644 --- a/netbox/utilities/forms/fields/expandable.py +++ b/netbox/utilities/forms/fields/expandable.py @@ -1,4 +1,5 @@ import re +import warnings import netaddr from django import forms @@ -70,3 +71,15 @@ class ExpandableIPNetworkField(forms.CharField): if family == 6 and re.search(IP6_EXPANSION_PATTERN, value): return list(expand_ipnetwork_pattern(value.lower(), 6)) return [value] + + +# TODO: Remove in NetBox v4.7.0 +def __getattr__(name): + if name == 'ExpandableIPAddressField': + warnings.warn( + "ExpandableIPAddressField has been renamed to ExpandableIPNetworkField. " + "ExpandableIPAddressField will be removed in NetBox v4.7.0.", + DeprecationWarning, + ) + return ExpandableIPNetworkField + raise AttributeError(f"module {__name__!r} has no attribute {name!r}")