From 72c356b993771063e080c7cb47b8fc23a964dc1a Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Thu, 8 Apr 2010 01:48:56 -0400 Subject: kind of merged question views, still have debugging to to --- forum/const.py | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) (limited to 'forum/const.py') 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 -- cgit v1.2.3-1-g7c22