How can I get at the column of a result if I have a variable for the column? The below is a simplified example. I have a variable that contains the column I want, which will be used in the query. I now want to get the same column from the result.
col_id = some_table.id
query = session.query(col_id)
for row in query:
id = row ?? col_id
I don't want to have to know the name of the column, as the actual code structure is more like this:
col_id, query = build_query()
for row in query:
id = row ?? col_id