Make the "Related Objects" pane in the detail view for "Tenant" extensible #13794
Labels
status: accepted
This issue has been accepted for implementation
type: feature
Introduction of new functionality to the application
Milestone
NetBox version
v3.6.1
Feature type
Change to existing functionality
Proposed functionality
On the right side of the detail view for a "Tenant" object there is a list of NetBox core models and object counts the tenant is assigned to. Currently the list of models in this view is hardcoded in
tenancy.TenantView.get_extra_content()
.It would be helpful for plugins supporting tenancy if that list could be extended, e.g. by providing a decorator that could be applied to models using tenancy similar to the mechanism used for the global search index.
Use case
In many cases it makes sense for plugins to use tenancy to indicate the ownership of or responsibility for objects, making it easier to filter for objects related, for instance, to a specific customer or department.
While tenancy itself is easy to implement, this does not reflect in the list of related objects for a tenant. The detail view for a tenant only shows NetBox core objects that are assigned to the tenant, not objects of plugin models.
This is especially annoying when a user wants to delete a tenant object, which is usually related to the target object using the referential integrity option
models.PROTECT
. So even if there are no related objects shown in the tenant view, the tenant still can't be deleted because there are unlisted objects still owned by it in the plugin's models.Database changes
Unknown, probably none - depending on how this can be implemented.
External dependencies
None.
The text was updated successfully, but these errors were encountered: