We are integrating askbot into our existing django site. We found the join table question_followed_by is empty even when we have created 9 questions.
mysql> describe question_followed_by;
+-------------+---------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+---------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| question_id | int(11) | NO | MUL | NULL | |
| user_id | int(11) | NO | MUL | NULL | |
+-------------+---------+------+-----+---------+----------------+
3 rows in set (0.00 sec)
mysql> select * from question_followed_by;
Empty set (0.00 sec)
mysql> select count(*) from question;
+----------+
| count(*) |
+----------+
| 9 |
+----------+
1 row in set (0.00 sec)
I'm wondering what would cause the join table to miss records?
Thanks a lot,
Alex
Maybe because nobody follows questions yet? Click follow button on a question and check the table again.
Hi Evgeny,
Thanks for the quick reply. Yes, you are right, it's because no one is following the question yet. However, I am wondering why would I get this exception?
The site runs perfectly with django's "manage.py runserver". However, when we deployed it onto our staging server, which uses mod_wsgi, we're getting "Cannot resolve keyword 'followed_questions' into field" error.
Here is the error message and call stack. You can see that the ForeignKey and ManyToManyField in Question model are both missing in the list:
FieldError at /askbot/question/9/where-to-go-for-lunch Cannot resolve keyword 'followed_questions' into field. Choices are: _message_set, about, bronze, comment_comments, comment_flags, consecutive_days_visit_count, country, date_joined, date_of_birth, display_tag_filter_strategy, email, email_isvalid, email_key, email_tag_filter_strategy, first_name, gold, gravatar, groups, has_custom_avatar, id, ignored_tags, interesting_tags, is_active, is_staff, is_superuser, last_login, last_name, last_seen, location, logentry, new_response_count, password, questions_per_page, real_name, reputation, seen_response_count, show_country, silver, status, user_permissions, username, userprofile, websiteuserprofile, website
Here is the call stack:
/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py in get_response
/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py in _wrapped_view
/var/www/askbot/hpsport/askbot/views/readers.py in question
/var/www/askbot/hpsport/askbot/forms.py in __init__
/usr/local/lib/python2.6/dist-packages/django/db/models/manager.py in all
/usr/local/lib/python2.6/dist-packages/django/db/models/fields/related.py in get_query_set
/usr/local/lib/python2.6/dist-packages/django/db/models/query.py in filter
/usr/local/lib/python2.6/dist-packages/django/db/models/query.py in _filter_or_exclude
/usr/local/lib/python2.6/dist-packages/django/db/models/sql/query.py in add_q
/usr/local/lib/python2.6/dist-packages/django/db/models/sql/query.py in add_filter
/usr/local/lib/python2.6/dist-packages/django/db/models/sql/query.py in setup_joins
Create your Q&A site at askbot.com. Managed Askbot hosting at just $15/mo. Dedicated hosting, support contracts, consulting services.
create your Q&A siteAsked: 2011-08-17 03:32:50 -0500
Seen: 102 times
Last updated: Aug 17 '11
Is it possible to evaluate the karma one receives at the site on a monthly basis?
Question missing from question_revision table!
Is there a specific version of PostgreSQL required?
How to migrate from MySQL to PostgresQL?
Which is a better database to use for Askbot, PostgreSQL or MySQL, and why?
Database error when running migrations
Copyright Askbot, 2010-2011. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.