divio / aldryn-newsblog

A combined news/weblog application for Aldryn and django CMS – part of the Essential Addons.
https://marketplace.django-cms.org/en/addons/browse/aldryn-newsblog/
Other
67 stars 118 forks source link

Suggested MIGRATIOIN_MODULES produces django.db.migrations.state.InvalidBasesError during migration #215

Closed mwilson-ns closed 9 years ago

mwilson-ns commented 9 years ago

I'm installing aldryn-newsblog into a new installation of djangocms and following the README closely.

When doing the initial migration my MIGRATION_MODULES setting is this:

MIGRATION_MODULES = {
    'djangocms_column': 'djangocms_column.migrations_django',
    'djangocms_flash': 'djangocms_flash.migrations_django',
    'djangocms_googlemap': 'djangocms_googlemap.migrations_django',
    'djangocms_inherit': 'djangocms_inherit.migrations_django',
    'djangocms_link': 'djangocms_link.migrations_django',
    'djangocms_style': 'djangocms_style.migrations_django',
    'djangocms_file': 'djangocms_file.migrations_django',
    'djangocms_picture': 'djangocms_picture.migrations_django',
    'djangocms_teaser': 'djangocms_teaser.migrations_django',
    'djangocms_video': 'djangocms_video.migrations_django',
#vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    'djangocms_text_ckeditor': 'djangocms_text_ckeditor.migrations_django',
    'filer': 'filer.migrations_django',
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
}

This produces:

% python manage.py migrate aldryn_newsblog                                                                                                             
/home/mwilson/devel/ns/quill_engage/django_testing/venv/lib/python2.7/site-packages/aldryn_newsblog/managers.py:31: RemovedInDjango18Warning: `RelatedManager.get_query_set` method should be renamed `get_queryset`.
  class RelatedManager(ManagerMixin, TranslatableManager):

/home/mwilson/devel/ns/quill_engage/django_testing/venv/lib/python2.7/site-packages/parler/forms.py:163: RemovedInDjango18Warning: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is deprecated - form ArticleAdminForm needs updating
  return super(TranslatableModelFormMetaclass, mcs).__new__(mcs, name, bases, attrs)

/home/mwilson/devel/ns/quill_engage/django_testing/venv/lib/python2.7/site-packages/parler/forms.py:163: RemovedInDjango18Warning: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is deprecated - form PersonForm needs updating
  return super(TranslatableModelFormMetaclass, mcs).__new__(mcs, name, bases, attrs)

/home/mwilson/devel/ns/quill_engage/django_testing/venv/lib/python2.7/site-packages/filer/fields/file.py:121: SyntaxWarning: FilerImageField can only be a ForeignKey to Image; filer.Image passed
  warnings.warn(msg, SyntaxWarning)

/home/mwilson/devel/ns/quill_engage/django_testing/venv/lib/python2.7/site-packages/filer/fields/multistorage_file.py:106: SyntaxWarning: MultiStorageFileField can handle only File objects;<function generate_filename_multistorage at 0x41fc0c8> passed
  "%s passed" % upload_to, SyntaxWarning)

Operations to perform:
  Apply all migrations: aldryn_newsblog
Running migrations:
  Applying taggit.0001_initial...Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/mwilson/devel/ns/quill_engage/django_testing/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/home/mwilson/devel/ns/quill_engage/django_testing/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 377, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/mwilson/devel/ns/quill_engage/django_testing/venv/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/mwilson/devel/ns/quill_engage/django_testing/venv/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "/home/mwilson/devel/ns/quill_engage/django_testing/venv/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 161, in handle
    executor.migrate(targets, plan, fake=options.get("fake", False))
  File "/home/mwilson/devel/ns/quill_engage/django_testing/venv/lib/python2.7/site-packages/django/db/migrations/executor.py", line 68, in migrate
    self.apply_migration(migration, fake=fake)
  File "/home/mwilson/devel/ns/quill_engage/django_testing/venv/lib/python2.7/site-packages/django/db/migrations/executor.py", line 96, in apply_migration
    if self.detect_soft_applied(migration):
  File "/home/mwilson/devel/ns/quill_engage/django_testing/venv/lib/python2.7/site-packages/django/db/migrations/executor.py", line 140, in detect_soft_applied
    apps = project_state.render()
  File "/home/mwilson/devel/ns/quill_engage/django_testing/venv/lib/python2.7/site-packages/django/db/migrations/state.py", line 75, in render
    "for more" % new_unrendered_models
django.db.migrations.state.InvalidBasesError: Cannot resolve bases for [<ModelState: 'djangocms_text_ckeditor.Text'>]
This can happen if you are inheriting models from an app with migrations (e.g. contrib.auth)
 in an app with no migrations; see https://docs.djangoproject.com/en/1.7/topics/migrations/#dependencies for more

I experimented with the contents of MIGRATION_MODULES, ultimately changing the contents to this:

MIGRATION_MODULES = {
    'djangocms_column': 'djangocms_column.migrations_django',
    'djangocms_flash': 'djangocms_flash.migrations_django',
    'djangocms_googlemap': 'djangocms_googlemap.migrations_django',
    'djangocms_inherit': 'djangocms_inherit.migrations_django',
    'djangocms_link': 'djangocms_link.migrations_django',
    'djangocms_style': 'djangocms_style.migrations_django',
    'djangocms_file': 'djangocms_file.migrations_django',
    'djangocms_picture': 'djangocms_picture.migrations_django',
    'djangocms_teaser': 'djangocms_teaser.migrations_django',
    'djangocms_video': 'djangocms_video.migrations_django',
#vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
#   'djangocms_text_ckeditor': 'djangocms_text_ckeditor.migrations_django',
    'filer': 'filer.migrations_django',
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
}

This configuration enables the migration to complete successfully

(venv)octet :: quill_engage/django_testing/cms ‹master*› % python manage.py migrate aldryn_newsblog                                                                                                             
/home/mwilson/devel/ns/quill_engage/django_testing/venv/lib/python2.7/site-packages/aldryn_newsblog/managers.py:31: RemovedInDjango18Warning: `RelatedManager.get_query_set` method should be renamed `get_queryset`.
  class RelatedManager(ManagerMixin, TranslatableManager):

/home/mwilson/devel/ns/quill_engage/django_testing/venv/lib/python2.7/site-packages/parler/forms.py:163: RemovedInDjango18Warning: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is deprecated - form ArticleAdminForm needs updating
  return super(TranslatableModelFormMetaclass, mcs).__new__(mcs, name, bases, attrs)

/home/mwilson/devel/ns/quill_engage/django_testing/venv/lib/python2.7/site-packages/parler/forms.py:163: RemovedInDjango18Warning: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is deprecated - form PersonForm needs updating
  return super(TranslatableModelFormMetaclass, mcs).__new__(mcs, name, bases, attrs)

/home/mwilson/devel/ns/quill_engage/django_testing/venv/lib/python2.7/site-packages/filer/fields/file.py:121: SyntaxWarning: FilerImageField can only be a ForeignKey to Image; filer.Image passed
  warnings.warn(msg, SyntaxWarning)

/home/mwilson/devel/ns/quill_engage/django_testing/venv/lib/python2.7/site-packages/filer/fields/multistorage_file.py:106: SyntaxWarning: MultiStorageFileField can handle only File objects;<function generate_filename_multistorage at 0x2adf0c8> passed
  "%s passed" % upload_to, SyntaxWarning)

Operations to perform:
  Apply all migrations: aldryn_newsblog
Running migrations:
  Applying taggit.0001_initial... OK
  Applying filer.0001_initial... OK
  Applying aldryn_people.0001_initial... OK
  Applying aldryn_categories.0001_initial... OK
  Applying aldryn_newsblog.0001_initial... OK
  Applying aldryn_newsblog.0002_newsblogconfig_template_prefix... OK
  Applying aldryn_newsblog.0003_auto_20150422_1921... OK

Could the README be incorrect?

Heres what I'm running in my virtualenv:

% pip freeze                                                                                                                                           
Django==1.7.8
Django-Select2==4.3.1
Pillow==2.8.0
South==1.0.2
Unidecode==0.04.17
YURL==0.13
aldryn-apphooks-config==0.2.4
aldryn-boilerplates==0.7
aldryn-categories==0.1.2
aldryn-common==0.1.3
aldryn-newsblog==0.9.5
aldryn-people==0.5.2
aldryn-reversion==0.0.3
aldryn-translation-tools==0.0.3
argparse==1.3.0
backport-collections==0.1
dj-database-url==0.3.0
django-appconf==1.0.1
django-appdata==0.1.4
django-classy-tags==0.6.1
django-cms==3.1.0
django-filer==0.9.9
django-mptt==0.6.1
django-parler==1.4
django-phonenumber-field==0.7.2
django-polymorphic==0.7.1
django-reversion==1.8.5
django-sekizai==0.8.1
django-sortedm2m==0.10.0
django-taggit==0.14.0
django-treebeard==3.0
djangocms-admin-style==0.2.5
djangocms-column==1.5
djangocms-file==0.1
djangocms-flash==0.2.0
djangocms-googlemap==0.2
djangocms-inherit==0.1
djangocms-installer==0.7.6
djangocms-link==1.6.1
djangocms-picture==0.1
djangocms-style==1.5
djangocms-teaser==0.1
djangocms-text-ckeditor==2.5.0b1
djangocms-video==0.1
easy-thumbnails==2.2
html5lib==0.999
lxml==3.4.4
phonenumbers==7.0.4
psycopg2==2.6
python-dateutil==2.4.2
pytz==2015.4
requests==2.7.0
six==1.9.0
tzlocal==1.1.3
vobject==0.6.6
wsgiref==0.1.2

EDIT: also, here's my python version:

% python --version  
Python 2.7.3
mkoistinen commented 9 years ago

To be honest, I've removed mention of MIGRATION MODELS from the instructions. These suggestions are (or should be) on the respective projects they affect.