Я использую sqlalchemy 0.8, и я хочу получить только имя столбца, а не весь столбец в таблице.Получение имени столбца конкретных данных с помощью sqlalchemy
вот код:
rec = raw_input("Enter keyword to search: ")
res = session.query(test.__table__).filter(test.fname == rec).first()
data = ','.join(map(str, res)) +","
print data
#saw this here @ SO but not the one I wanted. It displays all of the columns
columns = [m.key for m in data.columns]
print columns