Skip to content

Add get_model_urls() reference to register views included in NetBoxModel #17258

@dandunbar23

Description

@dandunbar23

Change Type

Addition

Area

Plugins

Proposed Changes

When subclassing NetBoxModel, the Journaling MixIn is automatically included in a new model. However, it took me a while to figure out how to include that tab in the detail view of the model and extend the URL. It requires:

from django.urls import path, include
from utilities.urls import get_model_urls

urlpatterns = (
    # Standard URL Patterns

    path("[seturl]/<int:pk>/", include(get_model_urls("[plugin_name]", "[model_name]")),),
)

This may be obvious to those who have more Django programming experience than I do, but I think it would be a worthwhile addition to the plugin development documentation to help people take advantage of the included MixIns.

Metadata

Metadata

Assignees

Labels

netboxstatus: acceptedThis issue has been accepted for implementationtype: documentationA change or addition to the documentation

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions