                      if any(path.m2m for path in path_info):
                          # This field is a m2m relation so we know we need to call distinct
                          return True
          return False
  
      def filter_queryset(self, request, queryset, view):
          search_fields = self.get_search_fields(view, request)
 
</s>
                else:
                    # This field has a custom __ query transform but is not a relational field.
                    break
                      if any(path.m2m for path in path_info):
                          # This field is a m2m relation so we know we need to call distinct
                          return True
                else:
                    # This field has a custom __ query transform but is not a relational field.
                    break
          return False
  
      def filter_queryset(self, request, queryset, view):
          search_fields = self.get_search_fields(view, request)
keep keep add keep keep keep keep
 SearchFilter to support JSONField and HStoreField (#7121)

* SearchFilter to support Custom query Transforms

Since Some fields support `__` as a custom Transform for query lookups we needed to update the m2m checking code to handle search_fields that contain __ that are not relationships.

* Update documentation on SearchFilter to include references to JSON and HStore Fields.
rest_framework/filters.py