March 2020
Intermediate to advanced
608 pages
17h 17m
English
When you look at the results in the browser, you will see the pagination controls, similar to the follo wing:

How do we achieve this? When QuerySet is filtered out, we will create a paginator object passing QuerySet and the maximal amount of items that we want to show per page, which is 24 here. Then, we will read the current page number from the query parameter, page. The next step is to retrieve the current page object from the paginator. If the page number is not an integer, we get the first page. If the number exceeds the number of possible pages, the last page is retrieved. The page object has methods and attributes necessary ...