2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-11 07:24:15 +00:00

Updated Part API

- categories can now be filtered by parent
- Added FilterChildren func to invenTree.models
This commit is contained in:
Oliver Walters
2017-04-14 13:09:24 +10:00
parent c4b7b80e1a
commit 7fe1c21ebd
5 changed files with 35 additions and 24 deletions

View File

@ -10,10 +10,10 @@ from . import views
categorypatterns = [
# Part category detail
url(r'^category/(?P<pk>[0-9]+)/$', views.PartCategoryDetail.as_view()),
url(r'^(?P<pk>[0-9]+)/?$', views.PartCategoryDetail.as_view()),
# List of top-level categories
url(r'^$', views.PartCategoryList.as_view())
url(r'^\?*[^/]*/?$', views.PartCategoryList.as_view())
]
partparampatterns = [
@ -47,13 +47,13 @@ urlpatterns = [
url(r'^(?P<pk>[0-9]+)/$', views.PartDetail.as_view()),
# Part categories
url(r'^category/', views.PartCategoryList.as_view()),
url(r'^category/?', include(categorypatterns)),
# Part parameters
url(r'^parameters/', include(partparampatterns)),
url(r'^parameters/?', include(partparampatterns)),
# Part templates
url(r'^templates/', include(parttemplatepatterns)),
url(r'^templates/?', include(parttemplatepatterns)),
# List parts with optional filters
url(r'^\?*[^/]*/?$', views.PartList.as_view()),