Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django 1.7, 1.8 and Python 3.x compatibility #45

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

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