-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Support the use of NetBox's generic views by plugins #8334
Comments
Hey, we actually implemented this functionality within a quite hacky plugin our my employer. We could contribute an initial implementation. Is this the desired approach? Best Regards, |
@johannwagner I think for the most part this amounts to "hardening" the existing view classes to make them suitable for use outside NetBox core. I'd be interested to see what changes you made. Is there a way you could share a summary, short of drafting a whole PR? |
Mostly it's fixing up the url names because of the plugin prefix. The rest "just works" but lacks a lot of documentation, because the public use wasn't intended yet. |
@johannwagner Roger. I know @DanSheps was working on that recently in the |
Yup, we have similar patches, I just looked it up.
Those patches enables us to write plugin with newly introduced models with almost no boilerplate. Most boilerplate code comes from the |
I also would like to see a better method of using different tabs within a detailed view, this is kinda hacky right now. |
Yeah, now that I see you are going the mkdocstring for documenting the API, I will work on cleaning up the view documentation |
@DanSheps I've started on this in the |
Sounds good with me. I will look into the button class thing, I think I might have covered that, I just need to double check. |
Closes #8334: Formally support use of generic views by plugins
NetBox version
v3.1.5
Feature type
New functionality
Proposed functionality
Formally support and document the use of NetBox's generic view classes by plugins. These are to include initially:
Additional views may also be added or created depending on feedback from plugin authors.
Most of these classes likely must undergo so amount of refactoring and formalization to ensure a degree of maturity suitable for the inclusion in a public framework.
Use case
Much like Django's own generic views, use of these views enables plugin authors to avoid writing a substantial amount of boilerplate code.
Database changes
No response
External dependencies
No response
The text was updated successfully, but these errors were encountered: