mirror of
https://github.com/inventree/InvenTree.git
synced 2025-12-16 09:18:10 +00:00
Remove prefetch_related from parametric data filter (#11007)
- Not required as we do not process the parameter fields in python
This commit is contained in:
@@ -183,8 +183,6 @@ def filter_parameters_by_value(
|
|||||||
# Combine the queries based on whether we are filtering by text or numeric value
|
# Combine the queries based on whether we are filtering by text or numeric value
|
||||||
q = query_text if text_only else query_text | query_numeric
|
q = query_text if text_only else query_text | query_numeric
|
||||||
|
|
||||||
# queryset = Parameter.objects.prefetch_related('template').all()
|
|
||||||
|
|
||||||
# Special handling for the '__ne' (not equal) operator
|
# Special handling for the '__ne' (not equal) operator
|
||||||
# In this case, we want the *opposite* of the above queries
|
# In this case, we want the *opposite* of the above queries
|
||||||
if invert:
|
if invert:
|
||||||
@@ -216,8 +214,6 @@ def filter_parametric_data(queryset: QuerySet, parameters: dict[str, str]) -> Qu
|
|||||||
|
|
||||||
Typically these filters would be provided against via an API request.
|
Typically these filters would be provided against via an API request.
|
||||||
"""
|
"""
|
||||||
queryset = queryset.prefetch_related('parameters_list', 'parameters_list__template')
|
|
||||||
|
|
||||||
# Allowed lookup operations for parameter values
|
# Allowed lookup operations for parameter values
|
||||||
operators = '|'.join(PARAMETER_FILTER_OPERATORS)
|
operators = '|'.join(PARAMETER_FILTER_OPERATORS)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user