~netlandish/django-pagination

5c2f4adb852f37e701af3f609f1605fc9ac874a7 — Gustavo Andres Morero 7 years ago 9e4cbdb
changing middleware for Django 1.10 support.
1 files changed, 5 insertions(+), 1 deletions(-)

M pagination/middleware.py
M pagination/middleware.py => pagination/middleware.py +5 -1
@@ 1,3 1,6 @@
from django.utils.deprecation import MiddlewareMixin


def get_page(self, suffix):
    """
    A function which will be monkeypatched onto the request to get the current


@@ 11,7 14,8 @@ def get_page(self, suffix):
    except (KeyError, ValueError, TypeError):
        return 1

class PaginationMiddleware(object):

class PaginationMiddleware(MiddlewareMixin):
    """
    Inserts a variable representing the current page onto the request object if
    it exists in either **GET** or **POST** portions of the request.