sql row factory

This commit is contained in:
2019-03-11 07:51:05 +01:00
parent fa152f4d46
commit e3eaba33ed
5 changed files with 20 additions and 5 deletions

0
helpers/__init__.py Normal file
View File

View File

@@ -0,0 +1,5 @@
def dict_factory(cursor, row):
d = {}
for idx, col in enumerate(cursor.description):
d[col[0]] = row[idx]
return d