mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-30 20:55:42 +00:00 
			
		
		
		
	Remove old tree classes
This commit is contained in:
		| @@ -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([ | ||||||
|   | |||||||
| @@ -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'), | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user