parameters: (self, request)
return_statement: return first_order_direction, first_order_field_index
docstring: Must be consistent with
          `django.contrib.admin.views.main.ChangeList.get_ordering`.
docstring_summary: Must be consistent with
          `django.contrib.admin.views.main.ChangeList.get_ordering`.
docstring_tokens: Must be consistent with django . contrib . admin . views . main . ChangeList . get_ordering .
function: def _get_first_ordering(self, request):
          """
          Must be consistent with
          `django.contrib.admin.views.main.ChangeList.get_ordering`.
          """
          order_var = request.GET.get(ORDER_VAR)
          if order_var is None:
              first_order_field_index = self.default_order_field_index
              first_order_direction = self.default_order_direction
          else:
              first_order_field_index = None
              first_order_direction = ""
              for p in order_var.split("."):
                  none, prefix, index = p.rpartition("-")
                  try:
                      index = int(index)
                  except ValueError:
                      continue  # skip it
                  else:
                      first_order_field_index = index - 1
                      first_order_direction = prefix
                      break
          return first_order_direction, first_order_field_index
function_tokens: def _get_first_ordering ( self , request ) : order_var = request . GET . get ( ORDER_VAR ) if order_var is None : first_order_field_index = self . default_order_field_index first_order_direction = self . default_order_direction else : first_order_field_index = None first_order_direction = "" for p in order_var . split ( "." ) : none , prefix , index = p . rpartition ( "-" ) try : index = int ( index ) except ValueError : continue # skip it else : first_order_field_index = index - 1 first_order_direction = prefix break return first_order_direction , first_order_field_index