def update_merchant(id): name = request.form['name'] location = request.form['location'] activated = request.form['activated'] merchant = Merchant(name, location, activated, id) merchant_repository.update(merchant) return redirect("/merchants")
def update_merchant(id): name = request.form["name"] street = request.form["street"] city = request.form["city"] merchant = Merchant(name, street, city, id) merchant_repository.update(merchant) return redirect("/merchants")
def update_merchant(id): merchant = merchant_repository.select(id) merchant.name = request.form['name'] merchant.active = request.form['active'] merchant_repository.update(merchant) return redirect("/merchants")
def update_merchant(id): name = request.form['name'] disable = True if 'disable' in request.form else False merchant = Merchant(name, disable, id) merchant_repository.update(merchant) return redirect("/merchants")
merchant_1 = Merchant("Asda") merchant_repository.save(merchant_1) merchant_2 = Merchant("Vodafone") merchant_repository.save(merchant_2) merchant_3 = Merchant("Adidas") merchant_repository.save(merchant_3) tag_1 = Tag("Finances") tag_repository.save(tag_1) tag_2 = Tag("Groceries") tag_repository.save(tag_2) tag_3 = Tag("Shopping") tag_repository.save(tag_3) transaction_1 = Transaction(50, merchant_1, tag_2) transaction_repository.save(transaction_1) transaction_2 = Transaction(65, merchant_3, tag_3) transaction_repository.save(transaction_2) transaction_3 = Transaction(20, merchant_2, tag_1) transaction_repository.save(transaction_3) merchant_repository.select_all() tag_repository.select_all() transaction_repository.select_all() merchant_1.name = "Tesco" merchant_repository.update(merchant_1) tag_1.category = "Bills" tag_repository.update(tag_1)
def update_merchant(id): name = request.form["name"] merchant = Merchant(name, id) merchant_repository.update(merchant) return redirect("/merchants")