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.
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 namedMyObjectFilterSet
.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.