URL cleanup

This commit is contained in:
Oliver Walters 2020-04-23 17:37:53 +10:00
parent 5d71cf85cc
commit 426aa9258c
3 changed files with 37 additions and 50 deletions

View File

@ -73,11 +73,17 @@ settings_urls = [
url(r'^.*$', SettingsView.as_view(template_name='InvenTree/settings/user.html'), name='settings'), url(r'^.*$', SettingsView.as_view(template_name='InvenTree/settings/user.html'), name='settings'),
] ]
dynamic_javascript_urls = [
]
urlpatterns = [ urlpatterns = [
url(r'^part/', include(part_urls)), url(r'^part/', include(part_urls)),
url(r'^supplier-part/', include(supplier_part_urls)), url(r'^supplier-part/', include(supplier_part_urls)),
url(r'^price-break/', include(price_break_urls)), url(r'^price-break/', include(price_break_urls)),
# "Dynamic" javascript files which are rendered using InvenTree templating.
url(r'^dynamic/', include(dynamic_javascript_urls)),
url(r'^common/', include(common_urls)), url(r'^common/', include(common_urls)),
url(r'^stock/', include(stock_urls)), url(r'^stock/', include(stock_urls)),

View File

@ -6,16 +6,6 @@ from django.conf.urls import url, include
from . import views from . import views
build_item_detail_urls = [
url('^edit/?', views.BuildItemEdit.as_view(), name='build-item-edit'),
url('^delete/?', views.BuildItemDelete.as_view(), name='build-item-delete'),
]
build_item_urls = [
url(r'^(?P<pk>\d+)/', include(build_item_detail_urls)),
url('^new/', views.BuildItemCreate.as_view(), name='build-item-create'),
]
build_detail_urls = [ build_detail_urls = [
url(r'^edit/', views.BuildUpdate.as_view(), name='build-edit'), url(r'^edit/', views.BuildUpdate.as_view(), name='build-edit'),
url(r'^allocate/', views.BuildAllocate.as_view(), name='build-allocate'), url(r'^allocate/', views.BuildAllocate.as_view(), name='build-allocate'),
@ -33,7 +23,13 @@ build_detail_urls = [
] ]
build_urls = [ build_urls = [
url(r'item/', include(build_item_urls)), url(r'item/', include([
url(r'^(?P<pk>\d+)/', include([
url('^edit/?', views.BuildItemEdit.as_view(), name='build-item-edit'),
url('^delete/?', views.BuildItemDelete.as_view(), name='build-item-delete'),
])),
url('^new/', views.BuildItemCreate.as_view(), name='build-item-create'),
])),
url(r'new/', views.BuildCreate.as_view(), name='build-create'), url(r'new/', views.BuildCreate.as_view(), name='build-create'),

View File

@ -9,12 +9,6 @@ from django.conf.urls import url, include
from . import views from . import views
purchase_order_attachment_urls = [
url(r'^new/', views.PurchaseOrderAttachmentCreate.as_view(), name='po-attachment-create'),
url(r'^(?P<pk>\d+)/edit/', views.PurchaseOrderAttachmentEdit.as_view(), name='po-attachment-edit'),
url(r'^(?P<pk>\d+)/delete/', views.PurchaseOrderAttachmentDelete.as_view(), name='po-attachment-delete'),
]
purchase_order_detail_urls = [ purchase_order_detail_urls = [
url(r'^cancel/', views.PurchaseOrderCancel.as_view(), name='po-cancel'), url(r'^cancel/', views.PurchaseOrderCancel.as_view(), name='po-cancel'),
@ -31,19 +25,6 @@ purchase_order_detail_urls = [
url(r'^.*$', views.PurchaseOrderDetail.as_view(), name='po-detail'), url(r'^.*$', views.PurchaseOrderDetail.as_view(), name='po-detail'),
] ]
po_line_item_detail_urls = [
url(r'^edit/', views.POLineItemEdit.as_view(), name='po-line-item-edit'),
url(r'^delete/', views.POLineItemDelete.as_view(), name='po-line-item-delete'),
]
po_line_urls = [
url(r'^new/', views.POLineItemCreate.as_view(), name='po-line-item-create'),
url(r'^(?P<pk>\d+)/', include(po_line_item_detail_urls)),
]
purchase_order_urls = [ purchase_order_urls = [
url(r'^new/', views.PurchaseOrderCreate.as_view(), name='po-create'), url(r'^new/', views.PurchaseOrderCreate.as_view(), name='po-create'),
@ -53,30 +34,24 @@ purchase_order_urls = [
# Display detail view for a single purchase order # Display detail view for a single purchase order
url(r'^(?P<pk>\d+)/', include(purchase_order_detail_urls)), url(r'^(?P<pk>\d+)/', include(purchase_order_detail_urls)),
url(r'^line/', include(po_line_urls)), url(r'^line/', include([
url(r'^new/', views.POLineItemCreate.as_view(), name='po-line-item-create'),
url(r'^(?P<pk>\d+)/', include([
url(r'^edit/', views.POLineItemEdit.as_view(), name='po-line-item-edit'),
url(r'^delete/', views.POLineItemDelete.as_view(), name='po-line-item-delete'),
])),
])),
url(r'^attachments/', include(purchase_order_attachment_urls)), url(r'^attachments/', include([
url(r'^new/', views.PurchaseOrderAttachmentCreate.as_view(), name='po-attachment-create'),
url(r'^(?P<pk>\d+)/edit/', views.PurchaseOrderAttachmentEdit.as_view(), name='po-attachment-edit'),
url(r'^(?P<pk>\d+)/delete/', views.PurchaseOrderAttachmentDelete.as_view(), name='po-attachment-delete'),
])),
# Display complete list of purchase orders # Display complete list of purchase orders
url(r'^.*$', views.PurchaseOrderIndex.as_view(), name='po-index'), url(r'^.*$', views.PurchaseOrderIndex.as_view(), name='po-index'),
] ]
so_line_urls = [
url(r'^new/', views.SOLineItemCreate.as_view(), name='so-line-item-create'),
url(r'^(?P<pk>\d+)/', include([
url(r'^edit/', views.SOLineItemEdit.as_view(), name='so-line-item-edit'),
url(r'^delete/', views.SOLineItemDelete.as_view(), name='so-line-item-delete'),
])),
]
sales_order_attachment_urls = [
url(r'^new/', views.SalesOrderAttachmentCreate.as_view(), name='so-attachment-create'),
url(r'^(?P<pk>\d+)/edit/', views.SalesOrderAttachmentEdit.as_view(), name='so-attachment-edit'),
url(r'^(?P<pk>\d+)/delete/', views.SalesOrderAttachmentDelete.as_view(), name='so-attachment-delete'),
]
sales_order_detail_urls = [ sales_order_detail_urls = [
url(r'^edit/', views.SalesOrderEdit.as_view(), name='so-edit'), url(r'^edit/', views.SalesOrderEdit.as_view(), name='so-edit'),
@ -91,7 +66,13 @@ sales_order_urls = [
url(r'^new/', views.SalesOrderCreate.as_view(), name='so-create'), url(r'^new/', views.SalesOrderCreate.as_view(), name='so-create'),
url(r'^line/', include(so_line_urls)), url(r'^line/', include([
url(r'^new/', views.SOLineItemCreate.as_view(), name='so-line-item-create'),
url(r'^(?P<pk>\d+)/', include([
url(r'^edit/', views.SOLineItemEdit.as_view(), name='so-line-item-edit'),
url(r'^delete/', views.SOLineItemDelete.as_view(), name='so-line-item-delete'),
])),
])),
# URLs for sales order allocations # URLs for sales order allocations
url(r'^allocation/', include([ url(r'^allocation/', include([
@ -102,7 +83,11 @@ sales_order_urls = [
])), ])),
])), ])),
url(r'^attachments/', include(sales_order_attachment_urls)), url(r'^attachments/', include([
url(r'^new/', views.SalesOrderAttachmentCreate.as_view(), name='so-attachment-create'),
url(r'^(?P<pk>\d+)/edit/', views.SalesOrderAttachmentEdit.as_view(), name='so-attachment-edit'),
url(r'^(?P<pk>\d+)/delete/', views.SalesOrderAttachmentDelete.as_view(), name='so-attachment-delete'),
])),
# Display detail view for a single SalesOrder # Display detail view for a single SalesOrder
url(r'^(?P<pk>\d+)/', include(sales_order_detail_urls)), url(r'^(?P<pk>\d+)/', include(sales_order_detail_urls)),