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

Establish a central registry for tracking the application of features (e.g. webhooks, custom links) to models #4368

Closed
jeremystretch opened this issue Mar 13, 2020 · 0 comments
Labels
status: accepted This issue has been accepted for implementation type: housekeeping Changes to the application which do not directly impact the end user

Comments

@jeremystretch
Copy link
Member

Proposed Changes

Establish an internal registry to use for tracking which models within NetBox support which features. This should be similar in nature to the way Django registers models for its admin site. (Currently, this is accomplished through the use of several constants which each define a QuerySet filter returning the appropriate models.)

This proposal does NOT effect any changes to the assignment of these features. It is an internal change only.

Justification

Employing a central registry obviates the need to maintain explicit lists of models and simplifies the registration process. We could use a decorator, such as:

@register('webhooks', 'custom_links')
class Foo(models.model):
    ...
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation type: housekeeping Changes to the application which do not directly impact the end user labels Mar 13, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Jun 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: housekeeping Changes to the application which do not directly impact the end user
Projects
None yet
Development

No branches or pull requests

1 participant