Remove old tree classes

This commit is contained in:
Oliver 2021-10-30 00:18:41 +11:00
parent a792903a79
commit 4eea8c8193
2 changed files with 0 additions and 34 deletions

View File

@ -50,21 +50,6 @@ from InvenTree.api import AttachmentMixin
from InvenTree.status_codes import BuildStatus 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): class CategoryList(generics.ListCreateAPIView):
""" API endpoint for accessing a list of PartCategory objects. """ API endpoint for accessing a list of PartCategory objects.
@ -1332,7 +1317,6 @@ class BomItemSubstituteDetail(generics.RetrieveUpdateDestroyAPIView):
part_api_urls = [ part_api_urls = [
url(r'^tree/?', PartCategoryTree.as_view(), name='api-part-tree'),
# Base URL for PartCategory API endpoints # Base URL for PartCategory API endpoints
url(r'^category/', include([ url(r'^category/', include([

View File

@ -48,22 +48,6 @@ from InvenTree.api import AttachmentMixin
from InvenTree.filters import InvenTreeOrderingFilter 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): class StockDetail(generics.RetrieveUpdateDestroyAPIView):
""" API detail endpoint for Stock object """ 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'^.*$', StockTrackingList.as_view(), name='api-stock-tracking-list'),
])), ])),
url(r'^tree/', StockCategoryTree.as_view(), name='api-stock-tree'),
# Detail for a single stock item # Detail for a single stock item
url(r'^(?P<pk>\d+)/', StockDetail.as_view(), name='api-stock-detail'), url(r'^(?P<pk>\d+)/', StockDetail.as_view(), name='api-stock-detail'),