2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-14 17:01:28 +00:00

Query improvements for BuildLine table (#5153)

- Prefetch / preselect related records
- Improve query speed
This commit is contained in:
Oliver
2023-07-04 19:24:36 +10:00
committed by GitHub
parent 17c2070503
commit 42fd4c7ee6
3 changed files with 39 additions and 10 deletions

View File

@ -308,10 +308,6 @@ class BuildLineEndpoint:
"""Override queryset to select-related and annotate"""
queryset = super().get_queryset()
queryset = queryset.select_related(
'build', 'bom_item',
)
queryset = build.serializers.BuildLineSerializer.annotate_queryset(queryset)
return queryset