From 4eea8c819315fc9213c1e70fc769a911131d903a Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 30 Oct 2021 00:18:41 +1100 Subject: [PATCH] Remove old tree classes --- InvenTree/part/api.py | 16 ---------------- InvenTree/stock/api.py | 18 ------------------ 2 files changed, 34 deletions(-) diff --git a/InvenTree/part/api.py b/InvenTree/part/api.py index 4dd9841332..64675fe852 100644 --- a/InvenTree/part/api.py +++ b/InvenTree/part/api.py @@ -50,21 +50,6 @@ from InvenTree.api import AttachmentMixin from InvenTree.status_codes import BuildStatus -class PartCategoryTree(TreeSerializer): - - title = _("Parts") - model = PartCategory - - queryset = PartCategory.objects.all() - - @property - def root_url(self): - return reverse('part-index') - - def get_items(self): - return PartCategory.objects.all().prefetch_related('parts', 'children') - - class CategoryList(generics.ListCreateAPIView): """ API endpoint for accessing a list of PartCategory objects. @@ -1332,7 +1317,6 @@ class BomItemSubstituteDetail(generics.RetrieveUpdateDestroyAPIView): part_api_urls = [ - url(r'^tree/?', PartCategoryTree.as_view(), name='api-part-tree'), # Base URL for PartCategory API endpoints url(r'^category/', include([ diff --git a/InvenTree/stock/api.py b/InvenTree/stock/api.py index d848f0e6b9..4c4ada105e 100644 --- a/InvenTree/stock/api.py +++ b/InvenTree/stock/api.py @@ -48,22 +48,6 @@ from InvenTree.api import AttachmentMixin from InvenTree.filters import InvenTreeOrderingFilter -class StockCategoryTree(TreeSerializer): - title = _('Stock') - model = StockLocation - - @property - def root_url(self): - return reverse('stock-index') - - def get_items(self): - return StockLocation.objects.all().prefetch_related('stock_items', 'children') - - permission_classes = [ - permissions.IsAuthenticated, - ] - - class StockDetail(generics.RetrieveUpdateDestroyAPIView): """ API detail endpoint for Stock object @@ -1105,8 +1089,6 @@ stock_api_urls = [ url(r'^.*$', StockTrackingList.as_view(), name='api-stock-tracking-list'), ])), - url(r'^tree/', StockCategoryTree.as_view(), name='api-stock-tree'), - # Detail for a single stock item url(r'^(?P\d+)/', StockDetail.as_view(), name='api-stock-detail'),