def meta(self, total, page=1, page_size=None):
        """
        Calculate statistics for a collection
        return: meta
        """
        if page_size is None or page_size < 0:
            page_size = self.page_size

        meta = {}
        meta['total'] = total
        meta['page_size'] = page_size
        meta['pages'] = math.ceil(meta['total']/page_size)
        meta['page'] = page
        meta['skip'] = page_size * (page-1)
        return meta
def meta ( self , total , page = 1 , page_size = None ) : if page_size is None or page_size < 0 : page_size = self . page_size meta = { } meta [ 'total' ] = total meta [ 'page_size' ] = page_size meta [ 'pages' ] = math . ceil ( meta [ 'total' ] / page_size ) meta [ 'page' ] = page meta [ 'skip' ] = page_size * ( page - 1 ) return meta
Calculate statistics for a collection
        return: meta