jmcclell / django-bootstrap-pagination

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

Convert from dictionary to list for page URLs #3

Closed jmcclell closed 12 years ago

jmcclell commented 12 years ago

Currently the page URLs object which stores a (supposedly) ordered list of URLs is implemented as a dictionary. @WoLpH noticed pages printing out of order, which would imply the dictionary is not iterating over its items() in the order they were inserted. As there is no need for dictionary functionality for this object, convert it to a list which guarantees insertion-order iteration provided it isn't later re-ordered.

wolph commented 12 years ago

A little docs on the issue: http://docs.python.org/library/stdtypes.html#dict.items

CPython implementation detail: Keys and values are listed in an arbitrary order which is non-random, varies across Python implementations, and depends on the dictionary’s history of insertions and deletions.