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

Allow plugin models to be used as CustomField object if they don't provide webhooks #13784

Closed
rixx opened this issue Sep 15, 2023 · 1 comment
Labels
type: feature Introduction of new functionality to the application

Comments

@rixx
Copy link

rixx commented Sep 15, 2023

NetBox version

master

Feature type

Data model extension

Proposed functionality

Currently, only plugin models that provide the webhooks feature set are selectable for related custom fields. (There's already a TODO note there calling this out.) I'd like to mark my plugin's models as suitable for custom fields even without providing webhook integration.

Use case

I usually subclass NetBoxModel in my plugins. However, in this plugin, I'm shipping multiple plugins in a single package. This means that the import path to a model may be my_bundle.appname.models.MyModel, whereas its app_name is just appname.MyModel. As the webhooks integration attempts a dynamic import and fails if it cannot import appname.serializers.MyModelSerializer, I chose to exclude the webhook integration – however, I'd still like the plugin model to be available for custom fields.

Database changes

External dependencies

@rixx rixx added the type: feature Introduction of new functionality to the application label Sep 15, 2023
@jeremystretch
Copy link
Member

This is one of the symptoms that would be corrected under #13427, and is currently planned for the v4.0 release. I'm going to close this out as it will be addressed by that work, but thank you for calling it out explicitly.

@jeremystretch jeremystretch closed this as not planned Won't fix, can't repro, duplicate, stale Sep 15, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

2 participants