mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Additional filtering options for name and IPN fields
This commit is contained in:
parent
f0e7826fdc
commit
79d90b1c4a
@ -349,10 +349,12 @@ class StockFilter(rest_filters.FilterSet):
|
||||
|
||||
# Part name filters
|
||||
name = rest_filters.CharFilter(label='Part name (case insensitive)', field_name='part__name', lookup_expr='iexact')
|
||||
name_contains = rest_filters.CharFilter(label='Part name contains (case insensitive)', field_name='part__name', lookup_expr='icontains')
|
||||
name_regex = rest_filters.CharFilter(label='Part name (regex)', field_name='part__name', lookup_expr='iregex')
|
||||
|
||||
# Part IPN filters
|
||||
ipn = rest_filters.CharFilter(label='Part IPN (case insensitive)', field_name='part__IPN', lookup_expr='iexact')
|
||||
ipn_contains = rest_filters.CharFilter(label='Part IPN contains (case insensitive)', field_name='part__IPN', lookup_expr='icontains')
|
||||
ipn_regex = rest_filters.CharFilter(label='Part IPN (regex)', field_name='part__IPN', lookup_expr='iregex')
|
||||
|
||||
# Part attribute filters
|
||||
@ -864,9 +866,6 @@ class StockList(generics.ListCreateAPIView):
|
||||
filters.OrderingFilter,
|
||||
]
|
||||
|
||||
filter_fields = [
|
||||
]
|
||||
|
||||
ordering_fields = [
|
||||
'part__name',
|
||||
'part__IPN',
|
||||
|
Loading…
Reference in New Issue
Block a user