Skip to content

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

Closed
@jeremystretch

Description

@jeremystretch

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):
    ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: acceptedThis issue has been accepted for implementationtype: housekeepingChanges to the application which do not directly impact the end user

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions