mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +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
|
||||
def setup_eager_loading(queryset):
|
||||
queryset = queryset.prefetch_related('category')
|
||||
queryset = queryset.prefetch_related('locations')
|
||||
return queryset
|
||||
|
||||
class Meta:
|
||||
|
Loading…
Reference in New Issue
Block a user