August 2016
Beginner to intermediate
717 pages
15h 24m
English
ListView is a CBV that displays a list of records for a given model. The view is generated to send a template object from which we view the list.
We will look at an example displaying the list of projects and create a link to the details of a project. To do this, we must add the following lines in the urls.py file:
from TasksManager.models import Project from django.views.generic.list import ListView
Add the following URLs to the file:
url (r'^project_list$', ListView.as_view(model=Project, template_name="en/public/project_list.html"), name="project_list"),
We will create the template that will be used to display the results in a tabular form by adding the following lines in the article_content
Read now
Unlock full access