@@ -427,31 +427,26 @@ def get_queryset(self, request):
427
427
if new_qs is not None :
428
428
qs = new_qs
429
429
430
- lookup_params_keys = remaining_lookup_params .keys ()
431
- model_field_names = set ((local_field .name for local_field in self .model ._meta .local_fields ))
432
- for key in lookup_params_keys :
433
- if key not in model_field_names :
434
- # means k only available in typesense
435
- value = remaining_lookup_params .pop (key )
436
- new_lookup_params = self .model .collection_class .get_django_lookup (key , value )
437
- remaining_lookup_params .update (new_lookup_params )
438
-
439
- try :
440
- # Finally, we apply the remaining lookup parameters from the query
441
- # string (i.e. those that haven't already been processed by the
442
- # filters).
443
- qs = qs .filter (** remaining_lookup_params )
444
- except (SuspiciousOperation , ImproperlyConfigured ):
445
- # Allow certain types of errors to be re-raised as-is so that the
446
- # caller can treat them in a special way.
447
- raise
448
- except Exception as e :
449
- # Every other error is caught with a naked except, because we don't
450
- # have any other way of validating lookup parameters. They might be
451
- # invalid if the keyword arguments are incorrect, or if the values
452
- # are not in the correct type, so we might get FieldError,
453
- # ValueError, ValidationError, or ?.
454
- raise IncorrectLookupParameters (e )
430
+ for param , value in remaining_lookup_params .items ():
431
+ try :
432
+ # Finally, we apply the remaining lookup parameters from the query
433
+ # string (i.e. those that haven't already been processed by the
434
+ # filters).
435
+ qs = qs .filter (** {param : value })
436
+ except (SuspiciousOperation , ImproperlyConfigured ):
437
+ # Allow certain types of errors to be re-raised as-is so that the
438
+ # caller can treat them in a special way.
439
+ raise
440
+ except Exception as e :
441
+ # Every other error is caught with a naked except, because we don't
442
+ # have any other way of validating lookup parameters. They might be
443
+ # invalid if the keyword arguments are incorrect, or if the values
444
+ # are not in the correct type, so we might get FieldError,
445
+ # ValueError, ValidationError, or ?.
446
+
447
+ # for django-typesense, possibly means k only available in typesense
448
+ new_lookup_params = self .model .collection_class .get_django_lookup (param , value , e )
449
+ qs = qs .filter (** new_lookup_params )
455
450
456
451
# Apply search results
457
452
qs , search_may_have_duplicates = self .model_admin .get_search_results (
0 commit comments