![]() | 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
}
![]() | 2 | No.2 Revision |
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
could contain the following:myproject/badgets.pymyproject/badges.py
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
}
![]() | 3 | No.3 Revision |
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
}