From: Albert Tugushev Date: Fri, 1 Jan 2016 15:17:24 +0000 (+0300) Subject: Force convert range to list for python3 compatible X-Git-Tag: 2.2.0~2^2~2 X-Git-Url: https://git.mdrn.pl/django-pagination.git/commitdiff_plain/b180263fd69054c1f16a3c97b283026137c78d7c?ds=sidebyside Force convert range to list for python3 compatible Resolve PR #32 --- diff --git a/linaro_django_pagination/templatetags/pagination_tags.py b/linaro_django_pagination/templatetags/pagination_tags.py index d07bc61..d6e121e 100644 --- a/linaro_django_pagination/templatetags/pagination_tags.py +++ b/linaro_django_pagination/templatetags/pagination_tags.py @@ -268,7 +268,7 @@ def paginate(context, window=DEFAULT_WINDOW, margin=DEFAULT_MARGIN): paginator = context['paginator'] page_obj = context['page_obj'] page_suffix = context.get('page_suffix', '') - page_range = paginator.page_range + page_range = list(paginator.page_range) # Calculate the record range in the current page for display. records = {'first': 1 + (page_obj.number - 1) * paginator.per_page} records['last'] = records['first'] + paginator.per_page - 1