Closed l4rth closed 9 years ago
Please add links to the "zinnia_association" (unknown to Google) and the "guide in the documentation". How can someone help you if they can't double-check the steps you say you have already done?
You have done a ./manage.py syncdb --migrate
, haven't you?
What's your Django version, django CMS version, Zinnia version, cmsplugin-zinnia version?
I think I wrote it wrong: I actually built the extension. But while going on, I found out that I used the way zinnia wants me to extend the entry model, which is not the way cmsplugin-zinnia wants it. So i will have to reformulate my question to: Is there a way (Tutorial or something) how to extend the Entry Model of zinnia with extensional fields like in zinnia itself?
I am providing source coude maybe this can help.
First I have created a package called zinnia_association and then built the model (zinnia_association/models.py):
from django.db import models
from zinnia.models_bases.entry import AbstractEntry
class AssociationBlog(AbstractEntry):
association = models.ForeignKey("associations.Association",
blank=True,
default=None,
null=True,
related_name='news')
def __str__(self):
return 'AssociationBlog %s' % self.title
class Meta(AbstractEntry.Meta):
abstract = True
I also use south so I added it to south and added the Entry Base Model
SOUTH_MIGRATION_MODULES = {
'zinnia': 'zinnia_association.migrations.zinnia',
}
ZINNIA_ENTRY_BASE_MODEL = 'zinnia_association.models.AssociationBlog'
Additionally I built an Admin part for it
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from zinnia.models.entry import Entry
from zinnia.admin.entry import EntryAdmin
class AssociationBlogAdmin(EntryAdmin):
fieldsets = ((_('Content'), {'fields': (
('title', 'status'), 'content', 'image', 'association')}),) + \
EntryAdmin.fieldsets[1:]
admin.site.unregister(Entry)
admin.site.register(Entry, AssociationBlogAdmin)
Which now i think should be altered to fit the django-cms admin part. Anyway I also added the package to the installed_apps
INSTALLED_APPS = (
... ,
'zinnia',
'cmsplugin_zinnia',
'zinnia_ckeditor',
'zinnia_extra'
)
And I get this error I posted above.
For me everything should be fine, but I don't know where your issue comes from.
If you want that someone do support for you, you must provide your code, not snippets, because developers are not medium, and nobody will spent time to reconstruct your project from copy/paste to help you.
Regards
I will try to provide code later, i have to remove things from the whole fact (I know developers are not medium i am one by myself but not in this field).
So what I get to know from your post, it's the right way to implement such an extension to the entry model even through django-cms?
So what I get to know from your post, it's the right way to implement such an extension to the entry model even through django-cms?
Normally even with django-cms, extensions for the Entry model should work. For the now, I don't know such a limitation like that. Investigations with a concrete example are needed.
I feel so dump. While I rebuild parts of the app in order to show the error I found out that, due to strange South problems, I had removed mysite.apps.zinnia_association before and later just added zinnia_association to the Installed_apps which lead to this error and which i overlooked several times. I am very sorry, that I may have wasted your time.
Lol, it's happen ! If your issue is solved, it's great.
Hi,
i added an extension to my django-cms 'zinnia_association' which extends the entry with a foreign key. I also added an admin.py with the integration for the admin panel. I followed the guide in the documentation. Now when i add 'zinnia_association' to the INSTALLED_APPS (after zinnia) I get the error: