brmbar.Account.add_barcode(): New method

This commit is contained in:
Petr Baudis 2012-09-26 03:31:51 +02:00
parent 8b4e916a6e
commit 4e1681cb94

View file

@ -78,3 +78,7 @@ class Account:
""" Common part of credit() and debit(). """
with closing(self.db.cursor()) as cur:
cur.execute("INSERT INTO transaction_splits (transaction, side, account, amount, memo) VALUES (%s, %s, %s, %s, %s)", [transaction, side, self.id, amount, memo])
def add_barcode(self, barcode):
with closing(self.db.cursor()) as cur:
cur.execute("INSERT INTO barcodes (account, barcode) VALUES (%s, %s)", [self.id, barcode])