parameters: (self)
return_statement: return ordering_fields
docstring: Returns a OrderedDict of ordering field column numbers and asc/desc
docstring_summary: Returns a OrderedDict of ordering field column numbers and asc/desc
docstring_tokens: Returns a OrderedDict of ordering field column numbers and asc / desc
function: def get_ordering_field_columns(self):
          """
          Returns a OrderedDict of ordering field column numbers and asc/desc
          """
  
          # We must cope with more than one column having the same underlying sort
          # field, so we base things on column numbers.
          ordering = self._get_default_ordering()
          ordering_fields = OrderedDict()
          if ORDER_VAR not in self.params or not self.params[ORDER_VAR]:
              # for ordering specified on ModelAdmin or model Meta, we don't know
              # the right column numbers absolutely, because there might be more
              # than one column associated with that ordering, so we guess.
              for field in ordering:
                  if field.startswith('-'):
                      field = field[1:]
                      order_type = 'desc'
                  else:
                      order_type = 'asc'
                  for attr in self.list_display:
                      if self.get_ordering_field(attr) == field:
                          ordering_fields[field] = order_type
                          break
          else:
              for p in self.params[ORDER_VAR].split('.'):
                  none, pfx, field_name = p.rpartition('-')
                  ordering_fields[field_name] = 'desc' if pfx == '-' else 'asc'
          return ordering_fields
function_tokens: def get_ordering_field_columns ( self ) : # We must cope with more than one column having the same underlying sort # field, so we base things on column numbers. ordering = self . _get_default_ordering ( ) ordering_fields = OrderedDict ( ) if ORDER_VAR not in self . params or not self . params [ ORDER_VAR ] : # for ordering specified on ModelAdmin or model Meta, we don't know # the right column numbers absolutely, because there might be more # than one column associated with that ordering, so we guess. for field in ordering : if field . startswith ( '-' ) : field = field [ 1 : ] order_type = 'desc' else : order_type = 'asc' for attr in self . list_display : if self . get_ordering_field ( attr ) == field : ordering_fields [ field ] = order_type break else : for p in self . params [ ORDER_VAR ] . split ( '.' ) : none , pfx , field_name = p . rpartition ( '-' ) ordering_fields [ field_name ] = 'desc' if pfx == '-' else 'asc' return ordering_fields