InvenTree/InvenTree/company/urls.py

33 lines
1.0 KiB
Python
Raw Normal View History

from django.conf.urls import url, include
from django.views.generic.base import RedirectView
from . import views
2018-04-18 23:01:07 +00:00
company_detail_urls = [
url(r'edit/?', views.CompanyEdit.as_view(), name='company-edit'),
url(r'delete/?', views.CompanyDelete.as_view(), name='company-delete'),
# url(r'orders/?', views.CompanyDetail.as_view(template_name='company/orders.html'), name='company-detail-orders'),
url(r'parts/?', views.CompanyDetail.as_view(template_name='company/detail_part.html'), name='company-detail-parts'),
2018-05-03 13:57:00 +00:00
url(r'thumbnail/?', views.CompanyImage.as_view(), name='company-image'),
# Any other URL
2018-04-18 23:01:07 +00:00
url(r'^.*$', views.CompanyDetail.as_view(), name='company-detail'),
]
2018-04-18 23:01:07 +00:00
company_urls = [
url(r'new/?', views.CompanyCreate.as_view(), name='company-create'),
2018-04-18 23:01:07 +00:00
url(r'^(?P<pk>\d+)/', include(company_detail_urls)),
2018-04-18 23:01:07 +00:00
url(r'', views.CompanyIndex.as_view(), name='company-index'),
# Redirect any other patterns
2018-04-18 23:01:07 +00:00
url(r'^.*$', RedirectView.as_view(url='', permanent=False), name='company-index'),
2018-04-15 15:02:17 +00:00
]