Files
postgres-web/pgweb/util/db.py
Magnus Hagander 789550515e Style fixups to pass pep checks
This fixes the style issues introduced in the patches for the new
release notes styles. Clearly a broken verification hook somewhere.
2019-03-10 08:24:01 -07:00

9 lines
257 B
Python

from django.db import connection
def exec_to_dict(query, params=None):
curs = connection.cursor()
curs.execute(query, params)
columns = [col[0] for col in curs.description]
return [dict(list(zip(columns, row))) for row in curs.fetchall()]