django-pure-pagination icon indicating copy to clipboard operation
django-pure-pagination copied to clipboard

python 3.10 AttributeError: module 'collections' has no attribute 'Iterable'

Open bwakkie opened this issue 3 years ago • 3 comments

Got an error when using python 3.10: I had to do the following change in order to have it back working in my project:

python3.10/site-packages/pure_pagination/paginator.py: replace the first line "import collections" into:

try: # Python 3.10
    from collections.abc import Iterable
except ImportError:
    from collections import Iterable

AND line 109 " elif isinstance(result, collections.Iterable):" into elif isinstance(result, Iterable):

bwakkie avatar Jan 26 '22 11:01 bwakkie

I have some question. I can’t find : elif isinstance(result, Iterable):

please show your python3.10/site-packages/pure_pagination/paginator.py ?

thanks

ImMacy avatar Jun 04 '22 05:06 ImMacy

hi,I have a similar problem

python 3.10 Django 4.0.5

Error during template rendering In template ~\templates\pure_pagination\pagination.html, error at line 11

Invalid block tag on line 11: 'ifequal', expected 'elif','else' or 'endif'. Did you forget to register or load this tag?

10 {% if page %} 11 {% ifequal page page_obj.number %} 12

  • {{ page }}
  • naturezen avatar Jun 29 '22 15:06 naturezen

    I have some question. I can’t find : elif isinstance(result, Iterable):

    please show your python3.10/site-packages/pure_pagination/paginator.py ?

    thanks

    Obviously you cant find it in the code as it needs to be changed into it. Read carefully ;-)

    bwakkie avatar Oct 16 '22 23:10 bwakkie