We will now build a very lightweight profile model to store additional information about our customers. The
Customer model will initially include three fields: a
ForeignKey to the
User model, an address, and a phone number. Because the profile model is simply a regular Django model class, any additional information can be added using the usual fields.
To simplify this model design slightly, we will also be creating a
CustomerAddress model that represents a specific address. It will include fields such as three lines of address information (apartment number, street name, and so on), city, postal code, and state information. The
CustomerAddress model will be referenced as a
ForeignKey from the
Here is the sample ...