mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-01 03:00:54 +00:00
Enable regex search (#4566)
* Adds custom search filter to allow 'regex' searching of results * Specify if "shell" can access database for certain commands * Bug fix for settings API - Do not allow cache on detail endpoints - Was causing strange error conditions with missing or duplicate PK values * Adds user setting to control regex search * Enable regex for search queries - bootstrap tables - search preview * Pass search options through bettererer * Refactor API endpoints to use new filter approach * Bump API version * Add "whole word" search - Closes https://github.com/inventree/InvenTree/issues/4510 * Handle case where existing fields are empty * pop > get
This commit is contained in:
@ -24,7 +24,7 @@ from company.models import Company, SupplierPart
|
||||
from company.serializers import CompanySerializer, SupplierPartSerializer
|
||||
from InvenTree.api import (APIDownloadMixin, AttachmentMixin,
|
||||
ListCreateDestroyAPIView, MetadataView, StatusView)
|
||||
from InvenTree.filters import InvenTreeOrderingFilter
|
||||
from InvenTree.filters import InvenTreeOrderingFilter, InvenTreeSearchFilter
|
||||
from InvenTree.helpers import (DownloadFile, extract_serial_numbers, isNull,
|
||||
str2bool, str2int)
|
||||
from InvenTree.mixins import (CreateAPI, CustomRetrieveUpdateDestroyAPI,
|
||||
@ -296,7 +296,7 @@ class StockLocationList(APIDownloadMixin, ListCreateAPI):
|
||||
|
||||
filter_backends = [
|
||||
DjangoFilterBackend,
|
||||
filters.SearchFilter,
|
||||
InvenTreeSearchFilter,
|
||||
filters.OrderingFilter,
|
||||
]
|
||||
|
||||
@ -1009,7 +1009,7 @@ class StockList(APIDownloadMixin, ListCreateDestroyAPIView):
|
||||
|
||||
filter_backends = [
|
||||
DjangoFilterBackend,
|
||||
filters.SearchFilter,
|
||||
InvenTreeSearchFilter,
|
||||
InvenTreeOrderingFilter,
|
||||
]
|
||||
|
||||
@ -1057,7 +1057,7 @@ class StockAttachmentList(AttachmentMixin, ListCreateDestroyAPIView):
|
||||
filter_backends = [
|
||||
DjangoFilterBackend,
|
||||
filters.OrderingFilter,
|
||||
filters.SearchFilter,
|
||||
InvenTreeSearchFilter,
|
||||
]
|
||||
|
||||
filterset_fields = [
|
||||
@ -1087,7 +1087,7 @@ class StockItemTestResultList(ListCreateDestroyAPIView):
|
||||
|
||||
filter_backends = [
|
||||
DjangoFilterBackend,
|
||||
filters.SearchFilter,
|
||||
InvenTreeSearchFilter,
|
||||
filters.OrderingFilter,
|
||||
]
|
||||
|
||||
@ -1312,7 +1312,7 @@ class StockTrackingList(ListAPI):
|
||||
|
||||
filter_backends = [
|
||||
DjangoFilterBackend,
|
||||
filters.SearchFilter,
|
||||
InvenTreeSearchFilter,
|
||||
filters.OrderingFilter,
|
||||
]
|
||||
|
||||
|
Reference in New Issue
Block a user