Django-filter: Django 1.11 compatibility issue - `cannot import name flatatt`

Created on 4 Apr 2017  路  4Comments  路  Source: carltongibson/django-filter

File "/.../environments/mspro/lib/python2.7/site-packages/django_filters/widgets.py", line 13, in <module> from django.forms.widgets import flatatt ImportError: cannot import name flatatt

Got the above when trying to upgrade to Django 1.11.

Most helpful comment

What version of django-filter are you using? This should have been fixed in the latest release (1.0.2)

All 4 comments

Seeing this as well:

  File "/Users/cbodkin/.virtualenvs/p2p-liveblog/lib/python2.7/site-packages/django_filters/widgets.py", line 13, in <module>
    from django.forms.widgets import flatatt
ImportError: cannot import name flatatt

It looks like the proper way to import that is:

from django.forms.utils import flatatt

See:
https://docs.djangoproject.com/en/1.10/_modules/django/forms/widgets/

What version of django-filter are you using? This should have been fixed in the latest release (1.0.2)

Ah, yes. That fixed it for me. Thanks.

Was this page helpful?
0 / 5 - 0 ratings