def pagination(self):
        params = self.params.getParams()

        if 'limit' in params: 
            limit = params.get('limit', 50)
            if int(limit[0]) > 100:
                limit = 100
            else:
                limit = int(limit[0])
        else:
            limit = 50

        if 'page' in params:
            page = int(params['page'][0])
        else:
            page = 1

        pagination = {}
        pagination['page'] = page
        pagination['limit'] = limit
        pagination['next'] = page + 1
        previous = page - 1
        if previous < 1:
            previous = None 
        pagination['previous'] = previous 
        return pagination
dataset/ETHPy150Open tgonzales/mingus/mingus/resources.py/Model.pagination/original