Hide plugin models from widgets if desired #8162

Closed
opened 2025-12-29 20:33:16 +01:00 by adam · 3 comments
Owner

Originally created by @dreng on GitHub (Jun 4, 2023).

NetBox version

v3.5.4-dev

Feature type

Change to existing functionality

Proposed functionality

Please implement a parameter for plugin models in order to make them hide from widgets' config. Something like:

class Meta:
    widget = False

Use case

It turned out that a misconfiguration within a widget may render NetBox unusable. See #12520. In this case a user tried to create a widget that contains a model from the NetBox Topology Views Plugin. This model has never been intended to be listed or counted. It has only one special custom view and no list view.

Adding this model will result in an error. As a result, no page can be opened any more. It is not exactly a bug, but it looks like one to the user.

Implementing the proposed parameter let plugin developers prevent this misconfiguration.

Another Solution would be to check if the model supports being counted before it shows up in the widget configuration. I don't know if that would be an easier way.

Database changes

None

External dependencies

None that I am aware of.

Originally created by @dreng on GitHub (Jun 4, 2023). ### NetBox version v3.5.4-dev ### Feature type Change to existing functionality ### Proposed functionality Please implement a parameter for plugin models in order to make them hide from widgets' config. Something like: ``` class Meta: widget = False ``` ### Use case It turned out that a misconfiguration within a widget may render NetBox unusable. See #12520. In this case a user tried to create a widget that contains a model from the NetBox Topology Views Plugin. This model has never been intended to be listed or counted. It has only one special custom view and no list view. Adding this model will result in an error. As a result, no page can be opened any more. It is not exactly a bug, but it looks like one to the user. Implementing the proposed parameter let plugin developers prevent this misconfiguration. Another Solution would be to check if the model supports being counted before it shows up in the widget configuration. I don't know if that would be an easier way. ### Database changes None ### External dependencies None that I am aware of.
adam added the type: featurestatus: under review labels 2025-12-29 20:33:16 +01:00
adam closed this issue 2025-12-29 20:33:16 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jun 14, 2023):

This model has never been intended to be listed or counted. It has only one special custom view and no list view.

This touches on the recurring theme of "public" vs "private" models in NetBox. We don't have a good solution for this currently.

@jeremystretch commented on GitHub (Jun 14, 2023): > This model has never been intended to be listed or counted. It has only one special custom view and no list view. This touches on the recurring theme of "public" vs "private" models in NetBox. We don't have a good solution for this currently.
Author
Owner

@github-actions[bot] commented on GitHub (Sep 13, 2023):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Sep 13, 2023): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@jeremystretch commented on GitHub (Oct 6, 2023):

I think this will be captured under #13427, so let's capture any further conversation related to this use case under that issue.

@jeremystretch commented on GitHub (Oct 6, 2023): I think this will be captured under #13427, so let's capture any further conversation related to this use case under that issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8162