|
|
@@ -9,6 +9,15 @@ class Registry(dict):
|
|
|
removed (though the value of each key is mutable).
|
|
|
"""
|
|
|
def __getitem__(self, key):
|
|
|
+ # TODO: Remove in NetBox v4.7
|
|
|
+ if key == 'models':
|
|
|
+ import warnings
|
|
|
+ warnings.warn(
|
|
|
+ 'The "models" registry key is deprecated and will be removed in NetBox v4.7. Registered models can be '
|
|
|
+ 'obtained by calling ObjectType.objects.public().',
|
|
|
+ DeprecationWarning,
|
|
|
+ stacklevel=2,
|
|
|
+ )
|
|
|
try:
|
|
|
return super().__getitem__(key)
|
|
|
except KeyError:
|
|
|
@@ -30,6 +39,7 @@ registry = Registry({
|
|
|
'filtersets': dict(),
|
|
|
'model_actions': collections.defaultdict(set),
|
|
|
'model_features': dict(),
|
|
|
+ # TODO: Remove in NetBox v4.7
|
|
|
'models': collections.defaultdict(set),
|
|
|
'plugins': dict(),
|
|
|
'request_processors': list(),
|