summaryrefslogtreecommitdiffstats
path: root/forum/conf/forum_data_rules.py
blob: f9c4afdaef9103e618387adbd5d6040701ea165b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
"""
Settings for forum data display and entry
"""
from forum.conf.settings_wrapper import settings
from forum.deps.livesettings import ConfigurationGroup, BooleanValue, IntegerValue
from forum.deps.livesettings import StringValue
from django.utils.translation import ugettext as _
from forum import const

FORUM_DATA_RULES = ConfigurationGroup(
                        'FORUM_DATA_RULES',
                        _('Settings for forum data entry and display')
                    )

settings.register(
    BooleanValue(
        FORUM_DATA_RULES,
        'WIKI_ON',
        default=True,
        description=_('Check to enable community wiki feature')
    )
)

settings.register(
    IntegerValue(
        FORUM_DATA_RULES,
        'MAX_TAG_LENGTH',
        default=20,
        description=_('Maximum length of tag (number of characters)')
    )
)

settings.register(
    IntegerValue(
        FORUM_DATA_RULES,
        'MAX_TAGS_PER_POST',
        default=5,
        description=_('Maximum number of tags per question')
    )
)

#todo: looks like there is a bug in forum.deps.livesettings 
#that does not allow Integer values with defaults and choices
settings.register(
    StringValue(
        FORUM_DATA_RULES,
        'DEFAULT_QUESTIONS_PAGE_SIZE',
        choices=const.PAGE_SIZE_CHOICES,
        default='30',
        description=_('Number of questions to list by default')
    )
)

settings.register(
    StringValue(
        FORUM_DATA_RULES,
        'UNANSWERED_QUESTION_MEANING',
        choices=const.UNANSWERED_QUESTION_MEANING_CHOICES,
        default='NO_ACCEPTED_ANSWERS',
        description=_('What should "unanswered question" mean?')
    )
)