Use six.moves.zip instead of itertools.izip.
This commit is contained in:
parent
0b2572b9a8
commit
5a239cb7b8
@ -17,9 +17,11 @@
|
|||||||
import urllib
|
import urllib
|
||||||
import copy
|
import copy
|
||||||
from math import ceil, floor
|
from math import ceil, floor
|
||||||
from itertools import izip, count
|
from itertools import count
|
||||||
from werkzeug.datastructures import MultiDict
|
from werkzeug.datastructures import MultiDict
|
||||||
|
|
||||||
|
from six.moves import zip
|
||||||
|
|
||||||
PAGINATION_DEFAULT_PER_PAGE = 30
|
PAGINATION_DEFAULT_PER_PAGE = 30
|
||||||
|
|
||||||
|
|
||||||
@ -52,7 +54,7 @@ class Pagination(object):
|
|||||||
if jump_to_id:
|
if jump_to_id:
|
||||||
cursor = copy.copy(self.cursor)
|
cursor = copy.copy(self.cursor)
|
||||||
|
|
||||||
for (doc, increment) in izip(cursor, count(0)):
|
for (doc, increment) in list(zip(cursor, count(0))):
|
||||||
if doc.id == jump_to_id:
|
if doc.id == jump_to_id:
|
||||||
self.page = 1 + int(floor(increment / self.per_page))
|
self.page = 1 + int(floor(increment / self.per_page))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user