From e6588a5eba3857b823026736bfb2d43112a0f316 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Fri, 28 Sep 2012 22:35:02 +0200 Subject: [PATCH] brmbarv3: Fix few unusued INSERT statements with syntax errors --- brmbar3/brmbar/Account.py | 2 +- brmbar3/brmbar/Currency.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/brmbar3/brmbar/Account.py b/brmbar3/brmbar/Account.py index 23ffd69..9c9b8f5 100644 --- a/brmbar3/brmbar/Account.py +++ b/brmbar3/brmbar/Account.py @@ -50,7 +50,7 @@ class Account: def create(cls, db, name, currency, acctype): """ Constructor for new account """ with closing(db.cursor()) as cur: - cur.execute("INSERT INTO accounts (name, currency, acctype) VALUES (?, ?, ?) RETURNING id", [name, currency, acctype]) + cur.execute("INSERT INTO accounts (name, currency, acctype) VALUES (%s, %s, %s) RETURNING id", [name, currency, acctype]) id = cur.fetchone()[0] return cls(db, name = name, id = id, currency = currency, acctype = acctype) diff --git a/brmbar3/brmbar/Currency.py b/brmbar3/brmbar/Currency.py index 725dcc5..e5bdccc 100644 --- a/brmbar3/brmbar/Currency.py +++ b/brmbar3/brmbar/Currency.py @@ -35,7 +35,7 @@ class Currency: def create(cls, db, name): """ Constructor for new currency """ with closing(db.cursor()) as cur: - cur.execute("INSERT INTO currencies (name) VALUES (?) RETURNING id", [name]) + cur.execute("INSERT INTO currencies (name) VALUES (%s) RETURNING id", [name]) id = cur.fetchone()[0] return cls.new(db, name = name, id = id)