mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Improve query speed for supplierpart api
This commit is contained in:
parent
9d5b938ced
commit
f19d4eec79
@ -75,7 +75,14 @@ class SupplierPartList(generics.ListCreateAPIView):
|
||||
- POST: Create a new SupplierPart object
|
||||
"""
|
||||
|
||||
queryset = SupplierPart.objects.all()
|
||||
queryset = SupplierPart.objects.all().prefetch_related(
|
||||
'part',
|
||||
'part__category',
|
||||
'part__stock_items',
|
||||
'part__bom_items',
|
||||
'part__builds',
|
||||
'supplier')
|
||||
|
||||
serializer_class = SupplierPartSerializer
|
||||
|
||||
permission_classes = [
|
||||
|
Loading…
Reference in New Issue
Block a user