def pages(self):
        """The total number of pages"""
        if self.per_page == 0 or self.total is None:
            pages = 0
        else:
            pages = int(ceil(self.total / float(self.per_page)))
        return pages
def pages ( self ) : if self . per_page == 0 or self . total is None : pages = 0 else : pages = int ( ceil ( self . total / float ( self . per_page ) ) ) return pages
The total number of pages