Add ability to search stock API

- serial number
- part information
This commit is contained in:
Oliver Walters 2020-09-19 21:49:07 +10:00
parent 2e1388475e
commit 083bfe05c0

View File

@ -440,6 +440,8 @@ class StockList(generics.ListCreateAPIView):
params = self.request.query_params
queryset = super().filter_queryset(queryset)
# Perform basic filtering:
# Note: We do not let DRF filter here, it be slow AF
@ -680,6 +682,13 @@ class StockList(generics.ListCreateAPIView):
filter_fields = [
]
search_fields = [
'serial',
'part__name',
'part__IPN',
'part__description'
]
class StockAttachmentList(generics.ListCreateAPIView, AttachmentMixin):
"""