[Django]-Attribute Error: 'QueryDict' object has no attribute 'iterlists'

3👍

iterlists() was undocumented function for QueryDict build on Py2. Use dict(request.GET.lists()) instead.

Read short description here

2👍

Python 2 -> 3 convention is to rename all iterX methods to X, so change dict(request.GET.iterlists()) to dict(request.GET.lists())

Django docs.

1👍

It seems that in the documentation that iterlists() is only available for Python 2

https://docs.djangoproject.com/en/1.11/ref/request-response/#django.http.QueryDict.iterlists

My assumptions is that you would probably use lists() in its place for Python 3

https://docs.djangoproject.com/en/1.11/ref/request-response/#django.http.QueryDict.iterlists

Hope that helps

Leave a comment