code: def paginate(self, skip, limit):
          
          if not self.count() or not limit:
              return
          skip = skip or 0
          pages = int(ceil(self.count() / float(limit)))
          limits = {}
          last = 0
          for i in range(pages):
              current = limit * i
              limits[last] = current
              last = current
          # example with count == 62
          # {0: 20, 20: 40, 40: 60, 60: 62}
          if limit and limit < self.count():
              limit = limits.get(skip, self.count())
              self.cursordat = self.cursordat[skip: limit]
docs: Paginate list of records