mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-30 20:55:42 +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:
		| @@ -8,12 +8,12 @@ from django.utils.decorators import method_decorator | ||||
| from django.views.decorators.cache import cache_page, never_cache | ||||
|  | ||||
| from django_filters.rest_framework import DjangoFilterBackend | ||||
| from rest_framework import filters | ||||
| from rest_framework.exceptions import NotFound | ||||
|  | ||||
| import common.models | ||||
| import InvenTree.helpers | ||||
| from InvenTree.api import MetadataView | ||||
| from InvenTree.filters import InvenTreeSearchFilter | ||||
| from InvenTree.mixins import ListAPI, RetrieveAPI, RetrieveUpdateDestroyAPI | ||||
| from InvenTree.tasks import offload_task | ||||
| from part.models import Part | ||||
| @@ -124,7 +124,7 @@ class LabelListView(LabelFilterMixin, ListAPI): | ||||
|  | ||||
|     filter_backends = [ | ||||
|         DjangoFilterBackend, | ||||
|         filters.SearchFilter | ||||
|         InvenTreeSearchFilter | ||||
|     ] | ||||
|  | ||||
|     filterset_fields = [ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user