#NEWLINE# def get_ordering_field_columns( self ) : #NEWLINE# #INDENT# '\n        Returns an OrderedDict of ordering field column numbers and asc/desc\n        ' #NEWLINE# ordering = self . _get_default_ordering ( ) #NEWLINE# ordering_fields = OrderedDict ( ) #NEWLINE# if ( self . ORDER_VAR not in self . params ) : #NEWLINE# #INDENT# for field in ordering : #NEWLINE# #INDENT# if field . startswith ( '-' ) : #NEWLINE# #INDENT# field = field [ 1 : ] #NEWLINE# order_type = 'desc' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# order_type = 'asc' #NEWLINE# #UNINDENT# for ( index , attr ) in enumerate ( self . list_display ) : #NEWLINE# #INDENT# if ( self . get_ordering_field ( attr ) == field ) : #NEWLINE# #INDENT# ordering_fields [ index ] = order_type #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# for p in self . params [ self . ORDER_VAR ] . split ( '.' ) : #NEWLINE# #INDENT# ( none , pfx , idx ) = p . rpartition ( '-' ) #NEWLINE# try : #NEWLINE# #INDENT# idx = int ( idx ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# ordering_fields [ idx ] = ( 'desc' if ( pfx == '-' ) else 'asc' ) #NEWLINE# #UNINDENT# #UNINDENT# return self