def register(username): print "REGISTERING: " + username db = bank_setup() newaccount = Bank() newaccount.username = username newaccount.deposit_address = bitcoin.get_new_address() newaccount.balance = 0 db.add(newaccount) db.commit()
def new_address(username): db = bank_setup() account = db.query(Bank).get(username) account.deposit_address = bitcoin.get_new_address() db.commit()