2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 11:10:54 +00:00

Improved API filtering for PartCategory

This commit is contained in:
Oliver Walters
2021-04-20 20:15:06 +10:00
parent 38eea21f4f
commit c5fa0bb459
6 changed files with 37 additions and 59 deletions

View File

@ -281,13 +281,13 @@ class StockLocationList(generics.ListCreateAPIView):
queryset = StockLocation.objects.all()
serializer_class = LocationSerializer
def get_queryset(self):
def filter_queryset(self, queryset):
"""
Custom filtering:
- Allow filtering by "null" parent to retrieve top-level stock locations
"""
queryset = super().get_queryset()
queryset = super().filter_queryset(queryset)
params = self.request.query_params

View File

@ -32,6 +32,7 @@
</div>
</div>
</div>
<table class='table table-striped table-condensed' data-toolbar='#button-toolbar' id='sublocation-table'></table>
</div>