Clarify requirements for module and class naming #9590

Closed
opened 2025-12-29 21:19:22 +01:00 by adam · 4 comments
Owner

Originally created by @peteeckel on GitHub (May 6, 2024).

Change Type

Addition

Area

Plugins

Proposed Changes

I'd like to suggest adding a clarification to the NetBox plugin developer documentation, specifically the section about filtersets.

As I learned the hard way, there is a strong requirement for the filtersets of a plugin to be defined in the module filtersets, and for the filterset class for an object named, e.g. MyObject to be named MyObjectFilterSet.

While this initially isn't obvious and filtersets not following this requirement will appear to work at first, there are some issues lurking if this requirement isn't satisfied. One of the issues is that the NetBox test suite for filtersets will fail if the naming isn't exactly like described above, I found today that selectors in model select fields will fail (silently, unless error mails are enabled) in that case. There are some more issues as well.

While all examples and the plugin tutorial are compliant, an explicit mention of the strict requirement to use that naming would be useful. I've seen a couple of plugins (including the original NetBox DNS when I started working on it) that don't, so it doesn't seem to be obvious, and just today there was another help request in the netbox-plugin-development Slack channel.

Originally created by @peteeckel on GitHub (May 6, 2024). ### Change Type Addition ### Area Plugins ### Proposed Changes I'd like to suggest adding a clarification to the NetBox plugin developer documentation, specifically the [section about filtersets](https://github.com/netbox-community/netbox-plugin-tutorial/blob/main/tutorial/step08-filter-sets.md). As I learned the hard way, there is a strong requirement for the filtersets of a plugin to be defined in the module `filtersets`, and for the filterset class for an object named, e.g. `MyObject` to be named `MyObjectFilterSet`. While this initially isn't obvious and filtersets not following this requirement will appear to work at first, there are some issues lurking if this requirement isn't satisfied. One of the issues is that the NetBox test suite for filtersets will fail if the naming isn't exactly like described above, I found today that selectors in model select fields will fail (silently, unless error mails are enabled) in that case. There are some more issues as well. While all examples and the plugin tutorial are compliant, an explicit mention of the strict requirement to use that naming would be useful. I've seen a couple of plugins (including the original NetBox DNS when I started working on it) that don't, so it doesn't seem to be obvious, and just today there was another help request in the netbox-plugin-development Slack channel.
adam added the type: documentationstatus: needs ownerpending closurenetbox labels 2025-12-29 21:19:22 +01:00
adam closed this issue 2025-12-29 21:19:22 +01:00
Author
Owner

@peteeckel commented on GitHub (May 7, 2024):

I could add a few sentences to the description if you assign this to me.

@peteeckel commented on GitHub (May 7, 2024): I could add a few sentences to the description if you assign this to me.
Author
Owner

@jeremystretch commented on GitHub (May 7, 2024):

Thanks @peteeckel!

@jeremystretch commented on GitHub (May 7, 2024): Thanks @peteeckel!
Author
Owner

@github-actions[bot] commented on GitHub (Jul 9, 2025):

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 (Jul 9, 2025): 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/main/CONTRIBUTING.md).
Author
Owner

@github-actions[bot] commented on GitHub (Aug 8, 2025):

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.

@github-actions[bot] commented on GitHub (Aug 8, 2025): This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9590