code: def get_ordering(self, request, queryset, view):
          params = view.get_request_feature(view.SORT)
          if params:
              fields = [param.strip() for param in params]
              valid_ordering, invalid_ordering = self.remove_invalid_fields(
                  queryset, fields, view
              )
              if invalid_ordering:
                  raise ValidationError(
                      "Invalid filter field: %s" % invalid_ordering
                  )
              else:
                  return valid_ordering
          return self.get_default_ordering(view)