Fantomas42 / django-blog-zinnia

Simple yet powerful and really extendable application for managing a blog within your Django Web site.
http://django-blog-zinnia.com/
BSD 3-Clause "New" or "Revised" License
2.11k stars 731 forks source link

'Cannot resolve keyword 'entries' into field. Choices are: comment_comments...' #172

Closed ckcollab closed 11 years ago

ckcollab commented 12 years ago

Hey gang,

I'm not quite sure why I'm getting this error, but I'm going here:

http://127.0.0.1:8000/admin/zinnia/entry/

And getting this:

FieldError at /admin/zinnia/entry/
Cannot resolve keyword 'entries' into field. Choices are: comment_comments, comment_flags, date_joined, email, first_name, forum, forumreadtracker, groups, id, is_active, is_staff, is_superuser, last_login, last_name, logentry, password, poll_answers, posts, pybb_profile, readed_forums, readed_topics, registrationprofile, subscriptions, topic, topicreadtracker, user_permissions, username, userprofile

But this page works:

http://127.0.0.1:8000/admin/zinnia/category/

I did syncdb --migrate; it all seems to be up to date! I'm using latest version from this repo. Trying to track down the error, I can't find it yet!

(Ps, thanks for releasing this awesome app, can't wait to use it!)


More info:

# around line 18
zinnia\admin\filters.py in lookups
        active_authors = Author.published.all().annotate( 

# around line 33
zinnia\managers.py in get_query_set
            entries__sites=Site.objects.get_current() 
Fantomas42 commented 12 years ago

Hi @ckcollab,

hmmm maybe it's another issue related to #161.

Can you tell me if the Zinnia's tables are created in the database ?

ckcollab commented 12 years ago

Database has table zinnia_category, entry, entry_authors, etc.. -- seems like they are there!

manage.py syncdb --migrate

...

Synced:
 > django.contrib.auth
 > django.contrib.contenttypes
 > django.contrib.sessions
 > django.contrib.comments
 > django.contrib.sites
 > django.contrib.messages
 > django.contrib.staticfiles
 > django.contrib.admin
 > south
 > sorl.thumbnail
 > pure_pagination
 > tagging
 > mptt
 > registration
 > django_tables2
 > fts

Migrated:
 - pybb
 - zinnia

Hrmmm...

Fantomas42 commented 12 years ago

Hmmm too.

Strange issue, it seems that the relation table zinnia_entry_sites has not been created.

Maybe a reset of the Zinnia's tables will solve the issue, but I don't know what is causing this behavior.

Regards

ckcollab commented 12 years ago

Alright, sounds good!

I deleted all the tables in the database, now syncdb/migrate isn't making new databases?! I'm pretty new to Django, I'm going to keep googling around trying to figure out how to reset this.

Thanks for your help!

ckcollab commented 12 years ago

Alright, I just deleted everything associated with zinnia (to my knowledge, content_types/auth permissions/etc.) and then removed the south migrations rows.

Migration worked,

Running migrations for zinnia:
 - Migrating forwards to 0010_publication_dates_unrequired.
 > zinnia:0001_initial
 > zinnia:0002_auto__add_field_entry_pingback_enabled
 > zinnia:0003_auto__chg_field_category_title__chg_field_category_slug__add_unique_
 > zinnia:0004_mptt_categories
 > zinnia:0005_entry_protection
 > zinnia:0006_entry_template
 > zinnia:0007_entry_featured
 > zinnia:0008_add_status_permission
 > zinnia:0009_change_mptt_field
 > zinnia:0010_publication_dates_unrequired
 - Loading initial data for zinnia.

But still, I get the same error! I want to use zinnia real bad, what's wrong?! I wonder what I coulda done to mess it up...

Fantomas42 commented 11 years ago

@ckcollab I don't have any idea of what is causing the issue... Exceptionally can you give me by email an SSH access to your instance for having a look on what is going on ?

ckcollab commented 11 years ago

I cant do that, but i would be more than happy to work this out somewhere on irc! :) im not sure what went wrong.

Fantomas42 commented 11 years ago

Okay, irc.freenode.net #zinnia.

Fantomas42 commented 11 years ago

Could you tell me if the latest commit resolve your issue like expected ?

ckcollab commented 11 years ago

Thanks, seems like that fixed it!

ghost commented 9 years ago

Hi Fantomas, i got error Cannot resolve keyword 'flags' into field. Choices are: comment, content_type, content_type_id, id, ip_address, is_public, is_removed, object_pk, site, site_id, submit_date, user, user_email, user_id, user_name, user_url i deleted database and re-create + call python manage.py syncdb What could be the problem?

kibe88 commented 9 years ago

@kolesnikovkhv hey, I was getting exactly the same error and it turned out that I forgot to install the django-contrib-comments app!

jeryini commented 9 years ago

That is correct. I was also migrating from 1.6 to 1.7. As you know, django.contrib.comments has been deprecated since 1.6, take a look in settings.py, if you still use django.contrib.comments. You need to replace it with django_comments.