Support PrimaryModel and OrganizationalModel in plugins #8336

Closed
opened 2025-12-29 20:35:29 +01:00 by adam · 5 comments
Owner

Originally created by @hagbarddenstore on GitHub (Jul 14, 2023).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.5.6

Feature type

Change to existing functionality

Proposed functionality

Add PrimaryModel and OrganizationalModel as supported models usable by plugins, like NetBoxModel.

Use case

Less code to be written when a plugin author wants their models to "look" like NetBox models.

Database changes

None

External dependencies

None

Originally created by @hagbarddenstore on GitHub (Jul 14, 2023). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.5.6 ### Feature type Change to existing functionality ### Proposed functionality Add `PrimaryModel` and `OrganizationalModel` as supported models usable by plugins, like `NetBoxModel`. ### Use case Less code to be written when a plugin author wants their models to "look" like NetBox models. ### Database changes None ### External dependencies None
adam closed this issue 2025-12-29 20:35:29 +01:00
Author
Owner

@DanSheps commented on GitHub (Jul 19, 2023):

Personally, I don't see the need.

PrimaryModel only adds description and comments, both of which can be added by individual plugins. OrganizationalModel adds name, slug and description. Again, nothing breaking and can easily be added by the developers themselves.

@DanSheps commented on GitHub (Jul 19, 2023): Personally, I don't see the need. PrimaryModel only adds description and comments, both of which can be added by individual plugins. OrganizationalModel adds name, slug and description. Again, nothing breaking and can easily be added by the developers themselves.
Author
Owner

@github-actions[bot] commented on GitHub (Jan 12, 2024):

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 (Jan 12, 2024): 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

@abhi1693 commented on GitHub (Jan 12, 2024):

PrimaryModel only adds description and comments, both of which can be added by individual plugins. OrganizationalModel adds name, slug and description. Again, nothing breaking and can easily be added by the developers themselves.

I beg to differ slightly. I feel it keeps the plugin development consistent with the rest of the application and avoids adding the same boilerplate code that NetBox core already provides.

@abhi1693 commented on GitHub (Jan 12, 2024): > PrimaryModel only adds description and comments, both of which can be added by individual plugins. OrganizationalModel adds name, slug and description. Again, nothing breaking and can easily be added by the developers themselves. I beg to differ slightly. I feel it keeps the plugin development consistent with the rest of the application and avoids adding the same boilerplate code that NetBox core already provides.
Author
Owner

@jeremystretch commented on GitHub (Feb 23, 2024):

I've tagged this as needs milestone, however we first need to decide whether we're going to commit to these concepts internally.

@jeremystretch commented on GitHub (Feb 23, 2024): I've tagged this as `needs milestone`, however we first need to decide whether we're going to commit to these concepts internally.
Author
Owner

@jeremystretch commented on GitHub (Oct 31, 2025):

I'm tagging this tentatively for NetBox v4.5, given our recent investment in standardizing usage of the base model classes under #20304.

@jeremystretch commented on GitHub (Oct 31, 2025): I'm tagging this tentatively for NetBox v4.5, given our recent investment in standardizing usage of the base model classes under #20304.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8336