From 5c2f4adb852f37e701af3f609f1605fc9ac874a7 Mon Sep 17 00:00:00 2001 From: Gustavo Andres Morero Date: Tue, 16 Aug 2016 12:29:36 -0300 Subject: [PATCH] changing middleware for Django 1.10 support. --- pagination/middleware.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pagination/middleware.py b/pagination/middleware.py index 045ba89..7bb6717 100644 --- a/pagination/middleware.py +++ b/pagination/middleware.py @@ -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. -- 2.45.2