mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 20:16:44 +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:
parent
6766063c8b
commit
cee1062b51
@ -61,6 +61,7 @@ class PartSerializer(serializers.ModelSerializer):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def setup_eager_loading(queryset):
|
def setup_eager_loading(queryset):
|
||||||
queryset = queryset.prefetch_related('category')
|
queryset = queryset.prefetch_related('category')
|
||||||
|
queryset = queryset.prefetch_related('locations')
|
||||||
return queryset
|
return queryset
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user