Due: Thursday October 18, 2012
You have to submit a web2py application in which you only do the database layout, in a file called hardwarestore.py listed right after db.py among the databases. There, you must define the database tables as you believe is appropriate to organize the information for a hypothetical hardware store called Nailit.
Nailit sells many products. Each product has a quantity in store, a price, a quantity in order, and information on the supplier from which it can be purchased (so Nailit can refill its stock). For suppliers, you must keep name, address, and then you can have a list of contact people: for each contact person you need to store name, email, phone, and a note (that you can use also to write the person's work description, e.g. sales representative).
Nailit also keeps information on customers, as it offers them a rebate program. For each customer, it keeps basic information such as name, phone, and email (of course, it may have only part of this information for each customer). Moreover, Nailit remembers all purchases by such customers, including all details -- in particular, including when the purchases occurred, and the price paid for each item. This is important, because the price a customer paid may not correspond to the current price of an item (prices change, there are special offers, etc).
You have to define the database tables for Nailit, using the db.define_table , Field(...) commands, as for any web2py application. You can use foreign keys in your declarations. I recommend reading how one-to-many and many-to-many relations are represented in web2py.