def new_transaction(): merchants = merchant_repository.select_all() categorys = category_repository.select_all() users = user_repository.select_all() return render_template("transactions/new.html", merchants=merchants, categorys=categorys, users=users)
def new_transaction(): merchants = merchant_repository.select_all() users = user_repository.select_all() tags = tag_repository.select_all() return render_template("/transactions/new.html", merchants=merchants, users=users, tags=tags)
def edit_transaction(id): transaction = transaction_repository.select(id) merchants = merchant_repository.select_all() tags = tag_repository.select_all() return render_template("transactions/edit.html", transaction=transaction, merchants=merchants, tags=tags)
def new_transaction(): users = user_repository.select_all() tags = tag_repository.select_all() merchants = merchant_repository.select_all() return render_template("transactions/new.html", users=users, tags=tags, merchants=merchants, title="New Transaction")
def edit_transaction(id): transaction = transaction_repository.select(id) merchants = merchant_repository.select_all() categorys = category_repository.select_all() users = user_repository.select_all() return render_template("transactions/edit.html", transaction=transaction, merchants=merchants, categorys=categorys, users=users)
def merchants(): merchants = merchant_repository.select_all() return render_template("merchants/index.html", merchants=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 new_merchant(): all_merchants = merchant_repository.select_all() return render_template("merchants/new.html", all_merchants=all_merchants)
def inject_users(): users = user_repository.select_all() merchants = merchant_repository.select_all() tags = tag_repository.select_all() return dict(users=users, merchants=merchants, tags=tags)