mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
eecb26676e
* Adds configurable setting for maximum remote image size * Add helper function for downloading image from remote URL - Will replace existing function - Performs more thorough sanity checking * Replace existing image downloading code - part image uses new generic function - company image uses new generic function * Rearrange settings * Refactor and cleanup existing views / forms * Add unit testing for image downloader function * Refactor image downloader forms - Part image download now uses the API - Company image download now uses the API - Remove outdated forms / views / templates * Increment API version * Prevent remote image download via API if the setting is not enabled * Do not attempt to validate or extract image from blank URL * Fix custom save() serializer methods
30 lines
1.0 KiB
Python
30 lines
1.0 KiB
Python
"""URL lookup for Company app."""
|
|
|
|
from django.urls import include, re_path
|
|
|
|
from . import views
|
|
|
|
company_urls = [
|
|
|
|
# Detail URLs for a specific Company instance
|
|
re_path(r'^(?P<pk>\d+)/', include([
|
|
re_path(r'^.*$', views.CompanyDetail.as_view(), name='company-detail'),
|
|
])),
|
|
|
|
re_path(r'suppliers/', views.CompanyIndex.as_view(), name='supplier-index'),
|
|
re_path(r'manufacturers/', views.CompanyIndex.as_view(), name='manufacturer-index'),
|
|
re_path(r'customers/', views.CompanyIndex.as_view(), name='customer-index'),
|
|
|
|
# Redirect any other patterns to the 'company' index which displays all companies
|
|
re_path(r'^.*$', views.CompanyIndex.as_view(), name='company-index'),
|
|
]
|
|
|
|
manufacturer_part_urls = [
|
|
|
|
re_path(r'^(?P<pk>\d+)/', views.ManufacturerPartDetail.as_view(template_name='company/manufacturer_part.html'), name='manufacturer-part-detail'),
|
|
]
|
|
|
|
supplier_part_urls = [
|
|
re_path(r'^(?P<pk>\d+)/', views.SupplierPartDetail.as_view(template_name='company/supplier_part.html'), name='supplier-part-detail'),
|
|
]
|