def save_transaction(t): global db db.execute( 'insert into transactions (date, payer, amount, memo, payee) values (?, ?, ?, ?, ?)', (format_tran_date_for_db(t.date), t.payer, t.amount, t.memo, t.payee)) db.commit()
def save_transaction(t): global db db.execute('insert into transactions (date, payer, amount, memo, payee) values (?, ?, ?, ?, ?)', ( format_tran_date_for_db(t.date), t.payer, t.amount, t.memo, t.payee ) ) db.commit()
def is_transaction_in_db(t): global db cur = db.execute( ''' select * from transactions where date = ? and payer = ? and amount = ? and memo = ? and payee = ? ''', (format_tran_date_for_db(t.date), t.payer, t.amount, t.memo, t.payee)) row = cur.fetchall() if not row: return False return True
def is_transaction_in_db(t): global db cur = db.execute(''' select * from transactions where date = ? and payer = ? and amount = ? and memo = ? and payee = ? ''', (format_tran_date_for_db(t.date), t.payer, t.amount, t.memo, t.payee)) row = cur.fetchall() if not row: return False return True