def _reverse_ordering(ordering_tuple):
 def invert(x):
  return (x[1:] if x.startswith(u'-') else (u'-' + x))
 return tuple([invert(item) for item in ordering_tuple])

def _reverse_ordering ( ordering_tuple ) : def invert ( x ) : return ( x [ 1 : ] if x . startswith ( u'-' ) else ( u'-' + x ) ) return tuple ( [ invert ( item ) for item in ordering_tuple ] )
given an order_by tuple such as reverse the ordering and return a new tuple .