# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+from django.utils.deprecation import MiddlewareMixin
-def get_page(self, suffix):
+
+def get_page(self, suffix=''):
"""
A function which will be monkeypatched onto the request to get the current
integer representing the current page.
"""
try:
- # REQUEST is deprecated as of Django 1.7.
key = 'page%s' % suffix
value = self.POST.get(key)
if value is None:
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.