jmcclell / django-bootstrap-pagination

Django template tag for rendering Page objects as Bootstrap pagination HTML
MIT License
212 stars 83 forks source link

Bug in pagination.html #5

Closed Cykooz closed 12 years ago

Cykooz commented 12 years ago

Now in pagination.html:

...
{% for pagenum, url in page_urls %}
...

need fix it to:

...
{% for pagenum, url in page_urls.items %}
...
jmcclell commented 12 years ago

Good catch. This is actually from a bad merge. The bug is in the template tag, not the template itself. A few releases ago I switched from using a dictionary to a list to hold the URLs, and that's how I'd like to keep it. I'll update the template tag with a patch and close this.

jmcclell commented 12 years ago

@Cykooz I want to point out, if you have fixed this in your local repo in the way you describe in the bug, you're going to want to undo that change and just pull down my latest commit. The reason is because if you continue to use a dictionary instead of a list, you'll find that in some scenarios (certain python versions, certain platforms, etc.) your page numbers will render out of order as dictionaries are not guaranteed to be ordered. This is why I switched to a list implementation in an earlier version.

Cykooz commented 12 years ago

Thank you, I'm using the version from pypi.