nodes: 0, module; 1, function_definition; 2, function_name:filter_queryset; 3, parameters; 4, block; 5, identifier:self; 6, identifier:request; 7, identifier:queryset; 8, identifier:view; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, if_statement; 13, return_statement; 14, comment:""""Filter the queryset, applying the ordering.
  
          The `ordering_param` can be overwritten here.
          In DRF, the ordering_param is 'ordering', but we support changing it
          to allow the viewset to control the parameter.
          """; 15, assignment; 16, assignment; 17, identifier:ordering; 18, block; 19, identifier:queryset; 20, attribute; 21, attribute; 22, identifier:ordering; 23, call; 24, return_statement; 25, identifier:self; 26, identifier:ordering_param; 27, identifier:view; 28, identifier:SORT; 29, attribute; 30, argument_list; 31, call; 32, identifier:self; 33, identifier:get_ordering; 34, identifier:request; 35, identifier:queryset; 36, identifier:view; 37, attribute; 38, argument_list; 39, identifier:queryset; 40, identifier:order_by; 41, list_splat; 42, identifier:ordering
code: def filter_queryset(self, request, queryset, view):
          """"Filter the queryset, applying the ordering.
  
          The `ordering_param` can be overwritten here.
          In DRF, the ordering_param is 'ordering', but we support changing it
          to allow the viewset to control the parameter.
          """
          self.ordering_param = view.SORT
  
          ordering = self.get_ordering(request, queryset, view)
          if ordering:
              return queryset.order_by(*ordering)
  
          return queryset