In the previous lesson, we got to the following structure:
# retrieve objects from the database
photos = Photo.objects.all()
# pass them to the template
render(request, 'polls/detail.html', {'photos': photos})
In this case:
- The subject area model is described using an ORM. In other cases, it isn't necessary because the repository is separate from the model
- The handler function accesses the model to perform the requested operations and outputs the necessary data to the template