В БД сохраняется UTF-8 строки, вместо \u
This commit is contained in:
10
app/db.py
10
app/db.py
@@ -50,7 +50,15 @@ class DataBase(object):
|
||||
table = 'donates'
|
||||
|
||||
cur = self.conn.cursor()
|
||||
cur.execute('INSERT INTO {table} ("data") VALUES (\'{data}\')'.format(table=table, data=json.dumps(data)))
|
||||
cur.execute(
|
||||
'INSERT INTO {table} ("data") VALUES (\'{data}\')'.format(
|
||||
table=table,
|
||||
data=json.dumps(
|
||||
data,
|
||||
ensure_ascii=False,
|
||||
),
|
||||
)
|
||||
)
|
||||
self.commit()
|
||||
cur.close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user