def order_column(column, order):
 if (not order):
  return column
 elif order.lower().startswith('asc'):
  return column.asc()
 elif order.lower().startswith('desc'):
  return column.desc()
 else:
  raise (ArgumentError('Unknown order %s for column %s') % (order, column))

def order_column ( column , order ) : if ( not order ) : return column elif order . lower ( ) . startswith ( 'asc' ) : return column . asc ( ) elif order . lower ( ) . startswith ( 'desc' ) : return column . desc ( ) else : raise ( ArgumentError ( 'Unknown order %s for column %s' ) % ( order , column ) )
orders a column according to order specified as string .