django-cms/djangocms-link

Exception in Django 1.11

tgckpg opened this issue · 1 comments

Scope

flatatt seemed to be removed from django.form.widgets in this version.

Proposed fix

change
from django.forms.widgets import flatatt
to
from django.forms.utils import flatatt

Traceback

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/var/www/myproject/env/lib/python3.6/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line
    utility.execute()
  File "/var/www/myproject/env/lib/python3.6/site-packages/django/core/management/__init__.py", line 337, in execute
    django.setup()
  File "/var/www/myproject/env/lib/python3.6/site-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/var/www/myproject/env/lib/python3.6/site-packages/django/apps/registry.py", line 108, in populate
    app_config.import_models()
  File "/var/www/myproject/env/lib/python3.6/site-packages/django/apps/config.py", line 202, in import_models
    self.models_module = import_module(models_module_name)
  File "/var/www/myproject/env/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
  File "/var/www/myproject/env/lib/python3.6/site-packages/djangocms_link/models.py", line 16, in <module>
    from djangocms_attributes_field.fields import AttributesField
  File "/var/www/myproject/env/lib/python3.6/site-packages/djangocms_attributes_field/fields.py", line 17, in <module>
    from .widgets import AttributesWidget
  File "/var/www/myproject/env/lib/python3.6/site-packages/djangocms_attributes_field/widgets.py", line 6, in <module>
    from django.forms.widgets import flatatt
ImportError: cannot import name 'flatatt'

Closing this here as its relevant to djangocms-attributes-field, thank you for the report @tgckpg