5

paginators.py (of django-paging package):

try:

_page = EndlessPage(list(self.object_list[bottom:top]), number, self) 

this line gives a `TypeError: unhashable type error, although that object_list comes from a standard QuerySet that can be used with [bottom:top] without a problem.

template:

{% with paginate(request, my_queryset) as results %}
{{ results.paging }}
    {% for result in results.objects %}
        {{ result }}
    {% endfor %}
{{ results.paging }}
{% endwith %}`

view:

my_objects = BetterPaginator(queryset,25)
page = 1
context = { 'my_queryset': my_objects.get_context(page) }
Void Null
  • 51
  • 2
  • That TypeError basically means it is expecting something like a dictionary. You're passing an "iteratable" not a "hashable". List can be iterated, dictionaries hashed. – stormlifter May 12 '14 at 17:45

0 Answers0