November 2015
Beginner to intermediate
840 pages
26h 30m
English
One of the key advantages of our mixin, and the way we are extending GCBV behavior is that it makes it easy to extend behavior across our site. For instance, we might decide to help users navigate pagination by adding first and last links to our pages. Because we’ve adhered to DRY, we only need to make changes in one Python class and one template.
We can start by modifying PageLinksMixin to generate the first and last links for us, as shown in Example 18.15.
Example 18.15: Project Code
organizer/utils.py in 439b4e2f3c
1 class PageLinksMixin: 2 page_kwarg = 'page' . ... 9 def first_page(self, page): 10 # don't show on first page 11 ...
Read now
Unlock full access