I want to log a complete row from a sqlalchemy query (ORM), when a specific bug appears (in my example this is when multiple rows where found, but this has nothing to do with the question). At the moment i adress every column like this.
try:
result = query.one_or_none()
except MultipleResultsFound:
self.logger.info('MultipleResultsFound!!')
for row in query.all():
self.logger.info('column1:{}, column2:{}, column3:{}'.
format(row.column1, row.column2, row.column3))
But there must be a better way without adressing every column to show every column in the log. How can i display all columns from a row with one simple command ?