code: 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
docs: The total number of pages