Skip to content

Conversation

@krallin
Copy link

@krallin krallin commented Jul 31, 2014

Hi there,

This PR is more there to highlight an issue than to propose an actual fix, but:

  • In Django 1.7, the paginator class no longer uses a range, but uses an "xrange" instead (on Python 2. On Python 3 xrange has become range).
  • On Python 2, xranges aren't sliceable, so attempting to slice what we got returns in an error.

https://github.com/ericflo/django-pagination/blob/master/pagination/templatetags/pagination_tags.py#L144

I suppose an actual fix should actually check for Python 2: there's no use coercing the range to a list on Python 3 as a Python 3 range can be sliced.

@krallin krallin changed the title Django 1.7 compatibility hotfix Django 1.7, 1.8 and Python 3.x compatibility Oct 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants