This commit is contained in:
Oliver 2021-07-28 23:47:50 +10:00
parent 5744796506
commit baa6283d20

View File

@ -91,6 +91,14 @@ class ManufacturerPartFilter(rest_filters.FilterSet):
Custom API filters for the ManufacturerPart list endpoint.
"""
class Meta:
model = ManufacturerPart
fields = [
'manufacturer',
'MPN',
'part',
]
# Filter by 'active' status of linked part
active = rest_filters.BooleanFilter(field_name='part__active')
@ -133,12 +141,6 @@ class ManufacturerPartList(generics.ListCreateAPIView):
filters.OrderingFilter,
]
filter_fields = [
'MPN',
'manufacturer',
'part',
]
search_fields = [
'manufacturer__name',
'description',