Ask Your Question

connecting new feature with karma

asked 2013-11-21 19:13:43 -0600

SocialQA's avatar

updated 2013-11-23 14:51:26 -0600

Evgeny's avatar

I am interest in building new feature to askbot but I want to make sure that these features are well connected with the karma system. Can someone give the framework of Karma and simple example where to begin with wiring up karma schema with new features. I think this would be help many other developers.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-11-23 14:46:38 -0600

Evgeny's avatar

updated 2013-11-23 14:51:02 -0600

You can use Repute objects - corresponding to the instance of adding/removing reputation to/from the account - to give karma to the users. Also remember that there is denormalized data of the total karma on the user objects called .reputation.

There is no convenience API for this at the moment, but as long as you create a valid Repute and update user's .reputation record, you can modify karma in other situations.

There is direct (but optional) link between the Repute and the Post object for which reputation was given. In order to link the repute for any type object, we'd need a generic relation instead of a ForeignKey.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2013-11-21 19:13:43 -0600

Seen: 223 times

Last updated: Nov 23 '13