def lower_column(col):
 old = None
 while ((col is not None) and (col is not old)):
  old = col
  if ((not hasattr(col, 'table')) or (not hasattr(col.table, 'froms'))):
   return col
  for f in col.table.froms:
   if (f.corresponding_column(col) is not None):
    col = f.corresponding_column(col)
 return old

def lower_column ( col ) : old = None while ( ( col is not None ) and ( col is not old ) ) : old = col if ( ( not hasattr ( col , 'table' ) ) or ( not hasattr ( col . table , 'froms' ) ) ) : return col for f in col . table . froms : if ( f . corresponding_column ( col ) is not None ) : col = f . corresponding_column ( col ) return old
return column from lower level tables if possible .