|
1 |
| -from django.urls import path |
2 |
| -from netbox.views.generic import ObjectChangeLogView |
| 1 | +from django.urls import include, path |
| 2 | +from utilities.urls import get_model_urls |
| 3 | + |
3 | 4 | from .models import (
|
4 | 5 | BGPSession, Community, RoutingPolicy,
|
5 | 6 | BGPPeerGroup, RoutingPolicyRule, PrefixList,
|
6 | 7 | PrefixListRule, CommunityList, CommunityListRule
|
7 | 8 | )
|
8 |
| - |
9 | 9 | from . import views
|
10 | 10 |
|
| 11 | +app_name = 'netbox_bgp' |
| 12 | + |
11 | 13 | urlpatterns = [
|
12 | 14 | # Community
|
13 | 15 | path('community/', views.CommunityListView.as_view(), name='community_list'),
|
|
18 | 20 | path('community/<int:pk>/', views.CommunityView.as_view(), name='community'),
|
19 | 21 | path('community/<int:pk>/edit/', views.CommunityEditView.as_view(), name='community_edit'),
|
20 | 22 | path('community/<int:pk>/delete/', views.CommunityDeleteView.as_view(), name='community_delete'),
|
21 |
| - path('community/<int:pk>/changelog/', ObjectChangeLogView.as_view(), name='community_changelog', kwargs={'model': Community}), |
| 23 | + path('community/<int:pk>/', include(get_model_urls('netbox_bgp', 'community'))), |
22 | 24 | # Community Lists
|
23 | 25 | path('community-list/', views.CommunityListListView.as_view(), name='communitylist_list'),
|
24 | 26 | path('community-list/add/', views.CommunityListEditView.as_view(), name='communitylist_add'),
|
|
28 | 30 | path('community-list/<int:pk>/', views.CommListView.as_view(), name='communitylist'),
|
29 | 31 | path('community-list/<int:pk>/edit/', views.CommunityListEditView.as_view(), name='communitylist_edit'),
|
30 | 32 | path('community-list/<int:pk>/delete/', views.CommunityListDeleteView.as_view(), name='communitylist_delete'),
|
31 |
| - path('community-list/<int:pk>/changelog/', ObjectChangeLogView.as_view(), name='communitylist_changelog', kwargs={'model': CommunityList}), |
| 33 | + path('community-list/<int:pk>/', include(get_model_urls('netbox_bgp', 'communitylist'))), |
32 | 34 | # Community List Rules
|
33 | 35 | path('community-list-rule/', views.CommunityListRuleListView.as_view(), name='communitylistrule_list'),
|
34 | 36 | path('community-list-rule/add/', views.CommunityListRuleEditView.as_view(), name='communitylistrule_add'),
|
35 | 37 | path('community-list-rule/delete/', views.CommunityListRuleBulkDeleteView.as_view(), name='communitylistrule_bulk_delete'),
|
36 | 38 | path('community-list-rule/<int:pk>/', views.CommunityListRuleView.as_view(), name='communitylistrule'),
|
37 | 39 | path('community-list-rule/<int:pk>/edit/', views.CommunityListRuleEditView.as_view(), name='communitylistrule_edit'),
|
38 | 40 | path('community-list-rule/<int:pk>/delete/', views.CommunityListRuleDeleteView.as_view(), name='communitylistrule_delete'),
|
39 |
| - path('community-list-rule/<int:pk>/changelog/', ObjectChangeLogView.as_view(), name='communitylistrule_changelog', kwargs={'model': CommunityListRule}), |
| 41 | + path('community-list-rule/<int:pk>/', include(get_model_urls('netbox_bgp', 'communitylistrule'))), |
40 | 42 | # Sessions
|
41 | 43 | path('session/', views.BGPSessionListView.as_view(), name='bgpsession_list'),
|
42 | 44 | path('session/add/', views.BGPSessionAddView.as_view(), name='bgpsession_add'),
|
|
46 | 48 | path('session/<int:pk>/', views.BGPSessionView.as_view(), name='bgpsession'),
|
47 | 49 | path('session/<int:pk>/edit/', views.BGPSessionEditView.as_view(), name='bgpsession_edit'),
|
48 | 50 | path('session/<int:pk>/delete/', views.BGPSessionDeleteView.as_view(), name='bgpsession_delete'),
|
49 |
| - path('session/<int:pk>/changelog/', ObjectChangeLogView.as_view(), name='bgpsession_changelog', kwargs={'model': BGPSession}), |
| 51 | + path('session/<int:pk>/', include(get_model_urls('netbox_bgp', 'bgpsession'))), |
50 | 52 | # Routing Policies
|
51 | 53 | path('routing-policy/', views.RoutingPolicyListView.as_view(), name='routingpolicy_list'),
|
52 | 54 | path('routing-policy/add/', views.RoutingPolicyEditView.as_view(), name='routingpolicy_add'),
|
|
56 | 58 | path('routing-policy/<int:pk>/', views.RoutingPolicyView.as_view(), name='routingpolicy'),
|
57 | 59 | path('routing-policy/<int:pk>/edit/', views.RoutingPolicyEditView.as_view(), name='routingpolicy_edit'),
|
58 | 60 | path('routing-policy/<int:pk>/delete/', views.RoutingPolicyDeleteView.as_view(), name='routingpolicy_delete'),
|
59 |
| - path('routing-policy/<int:pk>/changelog/', ObjectChangeLogView.as_view(), name='routingpolicy_changelog', kwargs={'model': RoutingPolicy}), |
| 61 | + path('routing-policy<int:pk>/', include(get_model_urls('netbox_bgp', 'routingpolicy'))), |
60 | 62 | # Peer Groups
|
61 | 63 | path('peer-group/', views.BGPPeerGroupListView.as_view(), name='bgppeergroup_list'),
|
62 | 64 | path('peer-group/add/', views.BGPPeerGroupEditView.as_view(), name='bgppeergroup_add'),
|
|
66 | 68 | path('peer-group/<int:pk>/', views.BGPPeerGroupView.as_view(), name='bgppeergroup'),
|
67 | 69 | path('peer-group/<int:pk>/edit/', views.BGPPeerGroupEditView.as_view(), name='bgppeergroup_edit'),
|
68 | 70 | path('peer-group/<int:pk>/delete/', views.BGPPeerGroupDeleteView.as_view(), name='bgppeergroup_delete'),
|
69 |
| - path('peer-group/<int:pk>/changelog/', ObjectChangeLogView.as_view(), name='bgppeergroup_changelog', kwargs={'model': BGPPeerGroup}), |
| 71 | + path('peer-group/<int:pk>/', include(get_model_urls('netbox_bgp', 'bgppeergroup'))), |
70 | 72 | # Routing Policy Rules
|
71 | 73 | path('routing-policy-rule/', views.RoutingPolicyRuleListView.as_view(), name='routingpolicyrule_list'),
|
72 | 74 | path('routing-policy-rule/add/', views.RoutingPolicyRuleEditView.as_view(), name='routingpolicyrule_add'),
|
73 | 75 | path('routing-policy-rule/delete/', views.RoutingPolicyRuleBulkDeleteView.as_view(), name='routingpolicyrule_bulk_delete'),
|
74 | 76 | path('routing-policy-rule/<int:pk>/', views.RoutingPolicyRuleView.as_view(), name='routingpolicyrule'),
|
75 | 77 | path('routing-policy-rule/<int:pk>/edit/', views.RoutingPolicyRuleEditView.as_view(), name='routingpolicyrule_edit'),
|
76 | 78 | path('routing-policy-rule/<int:pk>/delete/', views.RoutingPolicyRuleDeleteView.as_view(), name='routingpolicyrule_delete'),
|
77 |
| - path('routing-policy-rule/<int:pk>/changelog/', ObjectChangeLogView.as_view(), name='routingpolicyrule_changelog', kwargs={'model': RoutingPolicyRule}), |
| 79 | + path('routing-policy-rule/<int:pk>/', include(get_model_urls('netbox_bgp', 'routingpolicyrule'))), |
78 | 80 | # Prefix Lists
|
79 | 81 | path('prefix-list/', views.PrefixListListView.as_view(), name='prefixlist_list'),
|
80 | 82 | path('prefix-list/add/', views.PrefixListEditView.as_view(), name='prefixlist_add'),
|
|
84 | 86 | path('prefix-list/<int:pk>/', views.PrefixListView.as_view(), name='prefixlist'),
|
85 | 87 | path('prefix-list/<int:pk>/edit/', views.PrefixListEditView.as_view(), name='prefixlist_edit'),
|
86 | 88 | path('prefix-list/<int:pk>/delete/', views.PrefixListDeleteView.as_view(), name='prefixlist_delete'),
|
87 |
| - path('prefix-list/<int:pk>/changelog/', ObjectChangeLogView.as_view(), name='prefixlist_changelog', kwargs={'model': PrefixList}), |
| 89 | + path('prefix-list/<int:pk>/', include(get_model_urls('netbox_bgp', 'prefixlist'))), |
88 | 90 | # Prefix List Rules
|
89 | 91 | path('prefix-list-rule/', views.PrefixListRuleListView.as_view(), name='prefixlistrule_list'),
|
90 | 92 | path('prefix-list-rule/add/', views.PrefixListRuleEditView.as_view(), name='prefixlistrule_add'),
|
91 | 93 | path('prefix-list-rule/delete/', views.PrefixListRuleBulkDeleteView.as_view(), name='prefixlistrule_bulk_delete'),
|
92 | 94 | path('prefix-list-rule/<int:pk>/', views.PrefixListRuleView.as_view(), name='prefixlistrule'),
|
93 | 95 | path('prefix-list-rule/<int:pk>/edit/', views.PrefixListRuleEditView.as_view(), name='prefixlistrule_edit'),
|
94 | 96 | path('prefix-list-rule/<int:pk>/delete/', views.PrefixListRuleDeleteView.as_view(), name='prefixlistrule_delete'),
|
95 |
| - path('prefix-list-rule/<int:pk>/changelog/', ObjectChangeLogView.as_view(), name='prefixlistrule_changelog', kwargs={'model': PrefixListRule}), |
| 97 | + path('prefix-list-rule/<int:pk>/', include(get_model_urls('netbox_bgp', 'prefixlistrule'))), |
96 | 98 | ]
|
0 commit comments