In this assignment you have been given a mostly complete Django Project. The frontend for the application has been provided for you. The only things missing are:
- the Models
- the URLs
- the Views
More specifically...
This project represents a coffee store database and has 2 models:
CoffeeTransaction
Coffee has two fields: name and an price.
Transaction has four fields:
time: DateTime of the transactionitem- the coffee purchasedpre_tax- the price of the coffee purchasedtax- tax charged on the purchase (7% of price)
""should take you to a view named"home""coffee/<id>/buy"should take you to a view named"buy_coffee""transaction/<id>"should take you to a view named"transaction_detail"
- The
homeview should render"app/coffee_list.html"and provide allCoffees to the context using the key"coffees" - The
transaction_detailview should use the id provided through the path to get the appropriateTransactionfrom the database and render the"app/transaction_detail.html"template with thatTransactionprovided in the context using the keytransaction - The
buy_coffeeview should (on POST) create a newTransactionin the database using the coffee identified in the path. It should redirect totransaction_detailfor the newly createdTransaction.