Defined custom SupplierPart object manager and prefetch related models in all queries

This commit is contained in:
eeintech
2021-07-13 12:55:36 -04:00
parent 2295008944
commit 3d9ad24e27
3 changed files with 20 additions and 5 deletions

View File

@ -263,11 +263,7 @@ class SupplierPartList(generics.ListCreateAPIView):
- POST: Create a new SupplierPart object
"""
queryset = SupplierPart.objects.all().prefetch_related(
'part',
'supplier',
'manufacturer_part__manufacturer',
)
queryset = SupplierPart.objects.all()
def get_queryset(self):