mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-02 03:30:54 +00:00
New approach for multiple annotations
- Use the django-sql-utils addon - https://github.com/martsberger/django-sql-utils - The "distinct=True" flag was not doing what I thought it was doing...
This commit is contained in:
@ -377,6 +377,7 @@ class PartList(generics.ListCreateAPIView):
|
||||
def get_queryset(self, *args, **kwargs):
|
||||
|
||||
queryset = super().get_queryset(*args, **kwargs)
|
||||
|
||||
queryset = part_serializers.PartSerializer.prefetch_queryset(queryset)
|
||||
queryset = part_serializers.PartSerializer.annotate_queryset(queryset)
|
||||
|
||||
|
Reference in New Issue
Block a user