Closes #20129: Enable dynamic model feature registration (#20130)

* Closes #20129: Enable dynamic model feature registration

* Correct import path for register_model_feature()
This commit is contained in:
Jeremy Stretch
2025-08-19 18:20:32 -04:00
committed by GitHub
parent 6d4cc16ca4
commit a59da37ac3
6 changed files with 97 additions and 84 deletions

View File

@@ -135,9 +135,9 @@ class ObjectTypeManager(models.Manager):
"""
Return ObjectTypes only for models which support the given feature.
Only ObjectTypes which list the specified feature will be included. Supported features are declared in
netbox.models.features.FEATURES_MAP. For example, we can find all ObjectTypes for models which support event
rules with:
Only ObjectTypes which list the specified feature will be included. Supported features are declared in the
application registry under `registry["model_features"]`. For example, we can find all ObjectTypes for models
which support event rules with:
ObjectType.objects.with_feature('event_rules')
"""