Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

It is true that existing badges cannot be renamed without either implementing a (quite simple) feature to allow that or to patch the code.

However additional custom badges can be added by creating corresponding module and registering with Askbot with a setting (a very basic example, real implementation is more involved):

ASKBOT_CUSTOM_BADGES = 'myproject.badges.BADGES'

And the file myproject/badgets.py could contain the following:

from askbot.models.badges import Commentator
class CommentStar(Commentator):
    #identical to commentator, add code to modify
    #how to implement badges read file askbot/models/badges.py

#the dictionary below links "askbot events" (not the same as django signals) with badges.
#to learn about the supported events see askbot/models/badges.py
BADGES = {
    'post_comment': (CommentStar,), #when post is commented, badge CommentStar may be given
}

It is true that existing badges cannot be renamed without either implementing a (quite simple) feature to allow that or to patch the code.

However additional custom badges can be added by creating corresponding module and registering with Askbot with a setting (a very basic example, real implementation is more involved):

ASKBOT_CUSTOM_BADGES = 'myproject.badges.BADGES'

And the file myproject/badgets.pymyproject/badges.py could contain the following:

from askbot.models.badges import Commentator
class CommentStar(Commentator):
    #identical to commentator, add code to modify
    #how to implement badges read file askbot/models/badges.py

#the dictionary below links "askbot events" (not the same as django signals) with badges.
#to learn about the supported events see askbot/models/badges.py
BADGES = {
    'post_comment': (CommentStar,), #when post is commented, badge CommentStar may be given
}

It is true that existing badges cannot be renamed without either implementing a (quite simple) feature to allow that or to patch the code.

However additional custom badges can be added by creating corresponding module and registering with Askbot with a setting (a very basic example, real implementation is more involved):

ASKBOT_CUSTOM_BADGES = 'myproject.badges.BADGES'

And the file myproject/badges.py could contain the following:

from askbot.models.badges import Commentator
class CommentStar(Commentator):
    #identical to commentator, add code to modify
commentator
    #how to implement badges read file askbot/models/badges.py

#the dictionary below links "askbot events" (not the same as django signals) with badges.
#to learn about the supported events see askbot/models/badges.py
BADGES = {
    'post_comment': (CommentStar,), #when post is commented, badge CommentStar may be given
}