django-blog-zinnia / cmsplugin-zinnia

Bridge between django-blog-zinnia and django-cms
BSD 3-Clause "New" or "Revised" License
53 stars 46 forks source link

Latest release not working -> import error #9

Closed pakal closed 11 years ago

pakal commented 11 years ago

I don't know why, but the 0.3 of cmsplugiun-zinnia on pypi has a wrong "from zinnia.models import EntryAbstractClass" in placeholder.py, instead of the "from zinnia.models.entry import EntryAbstractClass" which was committed beore that release, in the git depot. So cmspluginzinnia fails if we don't use a fresh checkout instead of a pypi release.

murdav commented 11 years ago

I have a similar problem:

Plugin installed on my virtuaenv using: pip install cmsplugin_zinnia

Error: One or more models did not validate: cmsplugin_zinnia.latestentriesplugin: 'categories' has an m2m relation with model <class 'zinnia.models.category.Category'>, which has either not been installed or is abstract. cmsplugin_zinnia.selectedentriesplugin: 'entries' has an m2m relation with model <class 'zinnia.models.entry.Entry'>, which has either not been installed or is abstract.

Django 1.4.2 Django-cms 2.4.5

Ideas?

brp-log commented 11 years ago

I have excatly similar problem with the 0.4 of cmsplugin_zinnia...

Please need help.

Fantomas42 commented 11 years ago

Hi,

for me everything works fine the latest version of zinnia (v0.12.2) and cmsplugin_zinnia (v0.4). cmsplugin_zinnia 0.4 has been especially released to correct the import issue due to the changes of models organization within ZInnia.

So the first question is, what is your version Zinnia ?

Regards

brp-log commented 11 years ago

I have the same version, (v0.12.2 for zinnia an v0.4 for csmplugin)... And i have this: "G:\mycmsproject>python manage.py syncdb --all Error: One or more models did not validate: cmsplugin_zinnia.latestentriesplugin: 'tags' has an m2m relation with model <class 'tagging.models.Tag'>, which has either not been installed or is abstract."

Fantomas42 commented 11 years ago

For me the syncdb operation works fine, the issue is certainly related to your project installation.

Because Initially the issue is related to an import error which has been fixed, I close the issue.

timmyomahony commented 11 years ago

I was getting this issue when using my own custom Entry class that inherits from the cmsplugin_zinnia entry:

from django.contrib.contenttypes import generic
from cms.models.fields import PlaceholderField
from zinnia.models import EntryAbstractClass

class CustomEntry(EntryAbstractClass):
    """Entry with a Placeholder to edit content"""

    content_placeholder = PlaceholderField('content')
    resources = generic.GenericRelation("blog.Resource", object_id_field="object_id")

    @property
    def html_content(self):
        """No additional formatting is necessary"""
        return self.content

    class Meta(EntryAbstractClass.Meta):
        """EntryPlaceholder's Meta"""
        abstract = True

causing the warning:

/Users/foo/Sites/timmyomahony/lib/python2.7/site-packages/zinnia/models/entry.py:497: RuntimeWarning: blog.custom_entry.CustomEntry cannot be imported RuntimeWarning)

Investigating, the error that is being thrown is:

ImportError: cannot import name EntryAbstractClass

which is a result of a bad import: from zinnia.models import EntryAbstractClass. This needs to be changed to from zinnia.models.entry import EntryAbstractClass. This correct import is used in the newest cmsplugin_zinnia but because I was using a custom Entry class that I had copied from an older version of cmsplugin_zinnia, it was throwing the error. Hopefully this will be of use to someone in the future.

pymarco commented 10 years ago

I'm having the same issues as others

Django==1.5.5 django-cms==3.0b4.dev3 cmsplugin-zinnia==0.5.1

CommandError: One or more models did not validate:
cmsplugin_zinnia.latestentriesplugin: 'categories' has an m2m relation with model zinnia.Category, which has either not been installed or is abstract.
cmsplugin_zinnia.latestentriesplugin: 'authors' has an m2m relation with model zinnia.Author, which has either not been installed or is abstract.
cmsplugin_zinnia.latestentriesplugin: 'tags' has an m2m relation with model tagging.Tag, which has either not been installed or is abstract.
cmsplugin_zinnia.selectedentriesplugin: 'entries' has an m2m relation with model zinnia.Entry, which has either not been installed or is abstract.
bittner commented 10 years ago

According to (the README and) some comments from @Fantomas42 Zinnia is tested with django CMS 2.2+ only and may not be compatible with django CMS v3.0.

I'm not 100% sure, but there were (unconfirmed) hints on that in the discussion forum late last year: https://groups.google.com/forum/#!topic/django-blog-zinnia/WVo0B_1-nMU Clarifying the status of django CMS v3.0 support in the README would be good.

Fantomas42 commented 10 years ago

@pymarco

I presume that you have forgotten to install the zinnia applications into the INSTALLED_APPS, no ?

About django-cms 3.0, for the few tests have made, cmsplugin_zinnia is compatible, but it's not supported officially because I don't have time to support beta versions.