2

connecting new feature with karma

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.

SocialQA's avatar
265
SocialQA
asked 2013-11-21 19:13:43 -0600
Evgeny's avatar
13.2k
Evgeny
updated 2013-11-23 14:51:26 -0600
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

2

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.

Evgeny's avatar
13.2k
Evgeny
answered 2013-11-23 14:46:38 -0600, updated 2013-11-23 14:51:02 -0600
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments