rodrigobertin
9/17/2019 - 1:12 PM

Convert to dict, pewee raw sql

Convert to dict, pewee raw sql

def convert_to_dict(cursor):
    column_names = [x[0] for x in cursor.description]
    all_tables = [dict(zip(column_names, row)) for row in cursor.fetchall()]
    return all_tables