when using this useful plugin, something happens:
Bellow are the messages from pycharm.
`
File "E:\work\python\FollowUpSystem_H5_new\web\views.py", line 439, in get
patient_set_paged = p.page(page)
File "E:\work\python\env\FollowUpSystem\lib\site-packages\pure_pagination\paginator.py", line 54, in page
return Page(self.object_list[bottom:top], number, self)
File "E:\work\python\env\FollowUpSystem\lib\site-packages\pure_pagination\paginator.py", line 129, in init
self.number = PageRepresentation(number, self._other_page_querystring(number))
File "E:\work\python\env\FollowUpSystem\lib\site-packages\pure_pagination\paginator.py", line 206, in _other_page_querystring
return self.basequeryset.urlencode()
File "E:\work\python\env\FollowUpSystem\lib\site-packages\django\http\request.py", line 524, in urlencode
for v in list
File "E:\work\python\env\FollowUpSystem\lib\site-packages\django\http\request.py", line 524, in
for v in list_
AttributeError: 'int' object has no attribute 'encode'
把这一行中的reques去掉就行了
p = Paginator(object_list=patient_set, per_page=10, request=request)
变成:
p = Paginator(object_list=patient_set, per_page=10)
the second line above works.
when using this useful plugin, something happens: Bellow are the messages from pycharm. ` File "E:\work\python\FollowUpSystem_H5_new\web\views.py", line 439, in get patient_set_paged = p.page(page) File "E:\work\python\env\FollowUpSystem\lib\site-packages\pure_pagination\paginator.py", line 54, in page return Page(self.object_list[bottom:top], number, self) File "E:\work\python\env\FollowUpSystem\lib\site-packages\pure_pagination\paginator.py", line 129, in init self.number = PageRepresentation(number, self._other_page_querystring(number)) File "E:\work\python\env\FollowUpSystem\lib\site-packages\pure_pagination\paginator.py", line 206, in _other_page_querystring return self.basequeryset.urlencode() File "E:\work\python\env\FollowUpSystem\lib\site-packages\django\http\request.py", line 524, in urlencode for v in list File "E:\work\python\env\FollowUpSystem\lib\site-packages\django\http\request.py", line 524, in
for v in list_
AttributeError: 'int' object has no attribute 'encode'
**my codes**
try: page = request.GET.get('page', 1) except PageNotAnInteger: page = 1 p = Paginator(object_list=patient_set, per_page=10, request=request) patient_set_paged = p.page(page)` i will be very happy if i can get your help