We now have a relatively complete and sophisticated product catalog with products, categories, and additional product information. This acts as the core of our e-commerce application. Now we will write some quick views and get our catalog running and published to a web server.
In the Django design philosophy, views represent a specific interpretation of the data stored in our models. It is through views that templates, and ultimately the outside world, access our model data. Very often the model data we expose in our views are simply the model objects themselves. In other words, we provided direct access to a model object and all of its fields to the template.
Other times, we may be exposing smaller or larger portions of our model data, including QuerySets
or lists of models or a subset of all model data that match a specific filter or other ORM expression.
Exposing a full model object or set of objects according to some filter parameter, is so common that Django...