summaryrefslogtreecommitdiffstats
path: root/forum/const.py
diff options
context:
space:
mode:
Diffstat (limited to 'forum/const.py')
-rwxr-xr-xforum/const.py30
1 files changed, 23 insertions, 7 deletions
diff --git a/forum/const.py b/forum/const.py
index 7b78032a..6f6086f0 100755
--- a/forum/const.py
+++ b/forum/const.py
@@ -32,19 +32,34 @@ TYPE_REPUTATION = (
(-8, 'lose_by_upvote_canceled'),
)
+#do not translate these!!!
POST_SORT_METHODS = (
- _('newest'), _('oldest'),_('active'),
- _('inactive'),_('hot'),_('cold'),
- _('popular'),_('unpopular'),_('relevance')
+ ('latest', _('newest')),
+ ('oldest', _('oldest')),
+ ('active', _('active')),
+ ('inactive', _('inactive')),
+ ('hottest', _('hottest')),
+ ('coldest', _('coldest')),
+ ('mostvoted', _('most voted')),
+ ('leastvoted', _('least voted')),
+ ('relevant', _('relevance')),
)
#todo: add assertion here that all sort methods are unique
#because they are keys to the hash used in implementations of Q.run_advanced_search
-DEFAULT_POST_SORT_METHOD = _('newest')
-POST_SCOPES = (_('all'),_('unanswered'),_('favorite'))
-DEFAULT_POST_SCOPE = _('all')
+DEFAULT_POST_SORT_METHOD = 'latest'
+POST_SCOPE_LIST = (
+ ('all', _('all')),
+ ('unanswered', _('unanswered')),
+ ('favorite', _('favorite')),
+ )
+DEFAULT_POST_SCOPE = 'all'
+DEFAULT_QUESTIONS_PAGE_SIZE = 30
+PAGE_SIZES = (10,30,50)
-QUESTIONS_PAGE_SIZE = 30
+UNANSWERED_MEANING_LIST = ('NO_ANSWERS','NO_UPVOTED_ANSWERS','NO_ACCEPTED_ANSWERS')
+UNANSWERED_MEANING = 'NO_ANSWERS'
+assert(UNANSWERED_MEANING in UNANSWERED_MEANING_LIST)
#todo:
#this probably needs to be language-specific
@@ -53,6 +68,7 @@ QUESTIONS_PAGE_SIZE = 30
#correct regexes - plus this must be an anchored regex
#to do full string match
TAG_REGEX = r'^[a-z0-9\+\.\-]+$'
+TAG_SPLIT_REGEX = r'[ ,]+'
MAX_TAG_LENGTH = 20 #default 20 chars
MAX_TAGS_PER_POST = 5 #no more than five tags