diff --git a/InvenTree/InvenTree/api_urls.py b/InvenTree/InvenTree/api_urls.py deleted file mode 100644 index 0a742f2fe5..0000000000 --- a/InvenTree/InvenTree/api_urls.py +++ /dev/null @@ -1,12 +0,0 @@ -from django.conf.urls import url, include -from django.contrib import admin - -admin.site.site_header = "InvenTree Admin" - -urlpatterns = [ - url(r'^stock/', include('stock.urls')), - url(r'^part/', include('part.api_urls')), - url(r'^supplier/', include('supplier.urls')), - url(r'^track/', include('track.urls')), - url(r'^project/', include('project.api_urls')) -] diff --git a/InvenTree/InvenTree/models.py b/InvenTree/InvenTree/models.py index 0de4d636bb..033a8b3a09 100644 --- a/InvenTree/InvenTree/models.py +++ b/InvenTree/InvenTree/models.py @@ -77,6 +77,9 @@ class InvenTreeTree(models.Model): contents = ContentType.objects.get_for_model(type(self)) children = contents.get_all_objects_for_this_type(parent=self.id) + for child in children: + child.getUniqueChildren(unique) + return unique @property diff --git a/InvenTree/InvenTree/urls.py b/InvenTree/InvenTree/urls.py index b00372d97b..f4a6b74667 100644 --- a/InvenTree/InvenTree/urls.py +++ b/InvenTree/InvenTree/urls.py @@ -4,7 +4,6 @@ from django.contrib import admin admin.site.site_header = "InvenTree Admin" urlpatterns = [ - url(r'^api/', include('InvenTree.api_urls')), url(r'^stock/', include('stock.urls')), url(r'^part/', include('part.urls')), url(r'^supplier/', include('supplier.urls')), diff --git a/InvenTree/part/api_urls.py b/InvenTree/part/api_urls.py deleted file mode 100644 index c220617154..0000000000 --- a/InvenTree/part/api_urls.py +++ /dev/null @@ -1,17 +0,0 @@ -from django.conf.urls import url - -from . import views - -urlpatterns = [ - # Display part detail - url(r'^(?P[0-9]+)/$', views.PartDetail.as_view()), - - # Display a single part category - url(r'^category/(?P[0-9]+)/$', views.PartCategoryDetail.as_view()), - - # Display a list of top-level categories - url(r'^category/$', views.PartCategoryList.as_view()), - - # Display list of all parts - url(r'^$', views.PartList.as_view()) -] diff --git a/InvenTree/part/urls.py b/InvenTree/part/urls.py index f14151b51a..c220617154 100644 --- a/InvenTree/part/urls.py +++ b/InvenTree/part/urls.py @@ -3,9 +3,15 @@ from django.conf.urls import url from . import views urlpatterns = [ - # part landing page - url(r'^$', views.part_index), + # Display part detail + url(r'^(?P[0-9]+)/$', views.PartDetail.as_view()), - # part category landing page - url(r'^category/$', views.category_index) + # Display a single part category + url(r'^category/(?P[0-9]+)/$', views.PartCategoryDetail.as_view()), + + # Display a list of top-level categories + url(r'^category/$', views.PartCategoryList.as_view()), + + # Display list of all parts + url(r'^$', views.PartList.as_view()) ] diff --git a/InvenTree/project/api_urls.py b/InvenTree/project/api_urls.py deleted file mode 100644 index 65b34d128c..0000000000 --- a/InvenTree/project/api_urls.py +++ /dev/null @@ -1,6 +0,0 @@ -from django.conf.urls import url - -from . import views - -urlpatterns = [ -]