def update_tag(id): category = request.form["category"] tag = Tag(category, id) tag_repository.update(tag) return redirect("/categories")
def update_tag(id): name = request.form["name"] tag = Tag(name, id) tag_repository.update(tag) return redirect("/tags")
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(id): name = request.form['name'] updated_tag = Tag(name, id) tag_repository.update(updated_tag) return redirect("/tags")
def update_tag(id): tag = tag_repository.select(id) tag.category = request.form['category'] tag.active = request.form['active'] tag_repository.update(tag) return redirect("/tags")
def update_tag(id): tag_type = request.form["tag_type"] tag = Tag(tag_type, id) tag_repository.update(tag) return redirect("/tags")