First time here? Check out the FAQ!
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.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
SocialQA's avatar
265
SocialQA
asked 11 years ago
Evgeny's avatar
13.2k
Evgeny
updated 11 years ago

Comments

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.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
answered 11 years ago, updated 11 years ago
link

Comments

see more comments