diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2010-05-08 02:14:55 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2010-05-08 02:14:55 -0400 |
commit | a906fdb7b2ac7ca1d975a49996ebf7d01298090e (patch) | |
tree | 090ba8139bc7f01a1a0b94a374d17444f758906e /forum/conf | |
parent | 2c2308ad323362ed6f8765e79c781412f6827157 (diff) | |
download | askbot-a906fdb7b2ac7ca1d975a49996ebf7d01298090e.tar.gz askbot-a906fdb7b2ac7ca1d975a49996ebf7d01298090e.tar.bz2 askbot-a906fdb7b2ac7ca1d975a49996ebf7d01298090e.zip |
moved all settings from forum/auth.py to forum/conf/*
Diffstat (limited to 'forum/conf')
-rw-r--r-- | forum/conf/__init__.py | 21 | ||||
-rw-r--r-- | forum/conf/reputation_changes.py | 149 |
2 files changed, 153 insertions, 17 deletions
diff --git a/forum/conf/__init__.py b/forum/conf/__init__.py index 028f430a..6625ca5e 100644 --- a/forum/conf/__init__.py +++ b/forum/conf/__init__.py @@ -48,23 +48,10 @@ def setup_django_settings(settings): settings.TEMPLATE_CONTEXT_PROCESSORS = set(settings.TEMPLATE_CONTEXT_PROCESSORS) | set(TEMPLATE_CONTEXT_PROCESSORS) settings.TEMPLATE_DIRS = set(settings.TEMPLATE_DIRS) | set(TEMPLATE_DIRS) - -class AskbotConfigGroup(ConfigurationGroup): - def __init__(self, key, name, *arg, **kwarg): - super(AskbotConfigGroup, self).__init__(key, name, *arg,**kwarg) - self.item_count = 0 - def new_int_setting(self, key, value, description): - self.item_count += 1 - setting = config_register(IntegerValue( - self, - key, - default=value, - description=description, - ordering=self.item_count - ) - ) - return setting - +#import these to compile code and install values import forum.conf.minimum_reputation import forum.conf.vote_rules +import forum.conf.reputation_changes + +#import main settings object from forum.conf.settings_wrapper import settings diff --git a/forum/conf/reputation_changes.py b/forum/conf/reputation_changes.py new file mode 100644 index 00000000..cef177f5 --- /dev/null +++ b/forum/conf/reputation_changes.py @@ -0,0 +1,149 @@ +""" +Settings for reputation changes that apply to +user in response to various actions by the same +users or others +""" +from forum.conf.settings_wrapper import settings +from livesettings import ConfigurationGroup, IntegerValue +from django.utils.translation import ugettext as _ + +REP_CHANGES = ConfigurationGroup( + 'REP_CHANGES', + _('Reputaion loss and gain rules'), + ordering=2 + ) + +settings.register( + IntegerValue( + REP_CHANGES, + 'MAX_REP_GAIN_PER_USER_PER_DAY', + default=200, + description=_('Maximum daily reputation gain per user') + ) +) + +settings.register( + IntegerValue( + REP_CHANGES, + 'REP_GAIN_FOR_RECEIVING_UPVOTE', + default=10, + description=_('Gain for receiving an upvote') + ) +) + +settings.register( + IntegerValue( + REP_CHANGES, + 'REP_GAIN_FOR_RECEIVING_ANSWER_ACCEPTANCE', + default=15, + description=_('Gain for the author of accepted answer') + ) +) + +settings.register( + IntegerValue( + REP_CHANGES, + 'REP_GAIN_FOR_ACCEPTING_ANSWER', + default=2, + description=_('Gain for accepting best answer') + ) +) + +settings.register( + IntegerValue( + REP_CHANGES, + 'REP_GAIN_FOR_RECEIVING_DOWNVOTE_CANCELATION', + default=2, + description=_('Gain for post owner on canceled downvote') + ) +) + +settings.register( + IntegerValue( + REP_CHANGES, + 'REP_GAIN_FOR_CANCELING_DOWNVOTE', + default=1, + description=_('Gain for voter on canceling downvote') + ) +) +#'gain_by_canceling_downvote', + +settings.register( + IntegerValue( + REP_CHANGES, + 'REP_LOSS_FOR_CANCELING_ANSWER_ACCEPTANCE', + default=-2, + description=_('Loss for voter for canceling of answer acceptance') + ) +) +#'lose_by_canceling_accepted_answer', + +settings.register( + IntegerValue( + REP_CHANGES, + 'REP_LOSS_FOR_RECEIVING_CANCELATION_OF_ANSWER_ACCEPTANCE', + default=-5, + description=_('Loss for author whose answer was "un-accepted"') + ) +) +#'lose_by_accepted_answer_cancled', + +settings.register( + IntegerValue( + REP_CHANGES, + 'REP_LOSS_FOR_DOWNVOTING', + default=-2, + description=_('Loss for giving a downvote') + ) +) +#'lose_by_downvoted', + +settings.register( + IntegerValue( + REP_CHANGES, + 'REP_LOSS_FOR_RECEIVING_FLAG', + default=-2, + description=_('Loss for owner of post that was flagged offensive') + ) +) +#'lose_by_flagged', + +settings.register( + IntegerValue( + REP_CHANGES, + 'REP_LOSS_FOR_RECEIVING_DOWNVOTE', + default=-1, + description=_('Loss for owner of post that was downvoted') + ) +) +#'lose_by_downvoting', + +settings.register( + IntegerValue( + REP_CHANGES, + 'REP_LOSS_FOR_RECEIVING_THREE_FLAGS_PER_REVISION', + default=-30, + description=_('Loss for owner of post that was flagged 3 times per same revision') + ) +) +#'lose_by_flagged_lastrevision_3_times', + +settings.register( + IntegerValue( + REP_CHANGES, + 'REP_LOSS_FOR_RECEIVING_FIVE_FLAGS_PER_REVISION', + default=-100, + description=_('Loss for owner of post that was flagged 5 times per same revision') + ) +) +#'lose_by_flagged_lastrevision_5_times', + +settings.register( + IntegerValue( + REP_CHANGES, + 'REP_LOSS_FOR_RECEIVING_UPVOTE_CANCELATION', + default=-10, + description=_('Loss for post owner when upvote is canceled') + ) +) +#'lose_by_upvote_canceled', |