Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify requirements for module and class naming #15967

Open
peteeckel opened this issue May 6, 2024 · 2 comments · May be fixed by netbox-community/netbox-plugin-tutorial#35
Open

Clarify requirements for module and class naming #15967

peteeckel opened this issue May 6, 2024 · 2 comments · May be fixed by netbox-community/netbox-plugin-tutorial#35
Assignees
Labels
status: accepted This issue has been accepted for implementation type: documentation A change or addition to the documentation

Comments

@peteeckel
Copy link
Contributor

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.

@peteeckel peteeckel added status: needs triage This issue is awaiting triage by a maintainer type: documentation A change or addition to the documentation labels May 6, 2024
@arthanson arthanson added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation and removed status: needs triage This issue is awaiting triage by a maintainer labels May 6, 2024
@arthanson arthanson removed their assignment May 6, 2024
@arthanson arthanson added type: feature Introduction of new functionality to the application and removed type: feature Introduction of new functionality to the application labels May 6, 2024
@peteeckel
Copy link
Contributor Author

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

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels May 7, 2024
@jeremystretch
Copy link
Member

Thanks @peteeckel!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepted This issue has been accepted for implementation type: documentation A change or addition to the documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants