Skip to content

cleanup urls #128

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

Merged
merged 1 commit into from
Jul 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 12 additions & 38 deletions netbox_custom_objects/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,24 @@
from . import views
from .constants import APP_LABEL

app_name = APP_LABEL

urlpatterns = [
path('custom-object-types/', include(get_model_urls(APP_LABEL, 'customobjecttype', detail=False))),
path('custom-object-types/<int:pk>/', include(get_model_urls(APP_LABEL, 'customobjecttype'))),

# Custom Object Type Fields
path(
"custom_object_types/",
views.CustomObjectTypeListView.as_view(),
name="customobjecttype_list",
),
path(
"custom_object_types/add/",
views.CustomObjectTypeEditView.as_view(),
name="customobjecttype_add",
),
path(
"custom_object_types/import/",
views.CustomObjectTypeBulkImportView.as_view(),
name="customobjecttype_bulk_import",
),
path(
"custom_object_types/edit/",
views.CustomObjectTypeBulkEditView.as_view(),
name="customobjecttype_bulk_edit",
),
path(
"custom_object_types/delete/",
views.CustomObjectTypeBulkDeleteView.as_view(),
name="customobjecttype_bulk_delete",
),
path(
"custom_object_types/<int:pk>/",
include(get_model_urls(APP_LABEL, "customobjecttype")),
),
path(
"custom_object_type_fields/<int:pk>/",
"custom-object-type-fields/<int:pk>/",
include(get_model_urls(APP_LABEL, "customobjecttypefield")),
),
path(
"custom_object_type_fields/add/",
"custom-object-type-fields/add/",
views.CustomObjectTypeFieldEditView.as_view(),
name="customobjecttypefield_add",
),

# Custom Objects1
path(
"<str:custom_object_type>/",
views.CustomObjectListView.as_view(),
Expand All @@ -54,17 +33,12 @@
name="customobject_add",
),
path(
"<str:custom_object_type>/delete/",
views.CustomObjectDeleteView.as_view(),
name="customobject_delete",
),
path(
"<str:custom_object_type>/bulk_edit/",
"<str:custom_object_type>/bulk-edit/",
views.CustomObjectBulkEditView.as_view(),
name="customobject_bulk_edit",
),
path(
"<str:custom_object_type>/bulk_delete/",
"<str:custom_object_type>/bulk-delete/",
views.CustomObjectBulkDeleteView.as_view(),
name="customobject_bulk_delete",
),
Expand Down
1 change: 1 addition & 0 deletions netbox_custom_objects/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def get_extra_context(self, request, instance):
}


@register_model_view(CustomObjectType, 'add', detail=False)
@register_model_view(CustomObjectType, "edit")
class CustomObjectTypeEditView(generic.ObjectEditView):
queryset = CustomObjectType.objects.all()
Expand Down