mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-12 01:55:39 +00:00
Prefetch locations - 2.6s
However the 'total_stock' and 'available_stock' fields are still the majority of the response time
This commit is contained in:
@ -61,6 +61,7 @@ class PartSerializer(serializers.ModelSerializer):
|
||||
@staticmethod
|
||||
def setup_eager_loading(queryset):
|
||||
queryset = queryset.prefetch_related('category')
|
||||
queryset = queryset.prefetch_related('locations')
|
||||
return queryset
|
||||
|
||||
class Meta:
|
||||
|
Reference in New Issue
Block a user