fnp
/
django-pagination.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
986c8f6
)
Suppress warning, "RemovedInDjango19Warning: `request.REQUEST` is deprecated, use...
author
Yasuhisa Yamazaki
<1@yasu21.net>
Wed, 20 May 2015 10:09:46 +0000
(19:09 +0900)
committer
Yasuhisa Yamazaki
<1@yasu21.net>
Wed, 20 May 2015 12:54:13 +0000
(21:54 +0900)
(cherry picked from commit
9eba29b
)
linaro_django_pagination/middleware.py
patch
|
blob
|
history
diff --git
a/linaro_django_pagination/middleware.py
b/linaro_django_pagination/middleware.py
index
73d2713
..
580be43
100644
(file)
--- a/
linaro_django_pagination/middleware.py
+++ b/
linaro_django_pagination/middleware.py
@@
-35,7
+35,12
@@
def get_page(self, suffix):
integer representing the current page.
"""
try:
integer representing the current page.
"""
try:
- return int(self.REQUEST['page%s' % suffix])
+ # REQUEST is deprecated as of Django 1.7.
+ key = 'page%s' % suffix
+ value = self.POST.get(key)
+ if value is None:
+ value = self.GET.get(key)
+ return int(value)
except (KeyError, ValueError, TypeError):
return 1
except (KeyError, ValueError, TypeError):
return 1