Ask Your Question
1

How does followit module work?

asked 2011-06-03 15:04:34 -0500

NoahY gravatar image NoahY
313 4 2 14
https://github.com/NoahY/...

I installed the followit module as per the documentation, restarted my server, but still don't see any option to follow a user. Has this feature truly been implemented? Am I doing something wrong or overlooking something?

delete close flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2011-06-03 15:21:53 -0500

Evgeny gravatar image Evgeny flag of Chile
11074 50 84 182
http://askbot.org/

updated 2011-06-03 15:49:37 -0500

After the "followit" is added to the list of INSTALLED_APPS, and you run syncdb, in the output you should see info on newly created tables for following users.

If it does not tell that the tables were created, then something is wrong. The feature works here and on my development server.

Also a line must be added to your project's top level urls.py.

The app should allow to install the "bridge" tables after registering the models to follow anywhere in the models module. In askbot it is done

try:
    import followit
    followit.register(User) #allow users to follow other users
except ImportError:
    #don't do anything if followit app is not installed on the system.
    pass

This app creates a bridge model programmatically when calling followit.register(some_model_to_follow).

When you run syncdb it will also install any missing tables (but will not remove any unused tables) It is possible to register other models later and run syncdb again.

At the same time it adds methods:

To User (where x is the lowercased name of the model to follow):

  • get_followed_x()
  • is_following() (not sure, maybe it would be better to name it is_following_x() for consistency)
  • follow_x()
  • unfollow_x()

To the followed model - get_followers().

link publish delete flag offensive edit

Comments

something must be wrong... I added 'followit' to settings.py, and the pattern to urlpatterns in urls.py, then ran `python manage.py syncdb`. It says it synced followit, but I don't see any tables in the database for following... what are the table names that it creates? NoahY ( 2011-06-03 17:37:05 -0500 )edit
Noah, could you describe your environment? The table name is "followit_followuser" Evgeny ( 2011-06-03 17:49:10 -0500 )edit
Do you have "followit.register()" call in your askbot/models/__init__.py ? Evgeny ( 2011-06-03 17:50:47 -0500 )edit
I don't have a reference for followit in any of the files in the askbot directory... grep -R "followit" * brings up nothing :( NoahY ( 2011-06-03 19:44:14 -0500 )edit
I'm using MySQL, no table that starts with followit exists. NoahY ( 2011-06-03 19:46:13 -0500 )edit

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Reliable Askbot Hosting

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 site
30 days free trial

Question tools

Follow

subscribe to rss feed

Stats

Asked: 2011-06-03 15:04:34 -0500

Seen: 69 times

Last updated: Jun 03 '11