Fix string encoding on insert; adopt query parameters for update

This commit is contained in:
Timothy Carstens
2021-12-21 23:34:18 -08:00
parent 405242f6da
commit 66bf8acc71
2 changed files with 3 additions and 6 deletions

View File

@@ -64,9 +64,6 @@ def getValFromDB(obj_id = 1):
fields.sort()
repr = dict(zip(fields, cur.fetchall()[0][1:]))
field_types = {key: value.type for key, value in TestClass.__dataclass_fields__.items()}
for key in fields:
if field_types[key] == bytes:
repr[key] = bytes(repr[key], encoding='utf-8')
test_object = TestClass(**repr)
return test_object