class QuestionListPaginatorContext(pagination.PaginatorContext):
- def __init__(self, id='QUESTIONS_LIST', prefix='', default_pagesize=30):
+ def __init__(self, id='QUESTIONS_LIST', prefix='', pagesizes=(15, 30, 50), default_pagesize=30):
super (QuestionListPaginatorContext, self).__init__(id, sort_methods=(
(_('active'), pagination.SimpleSort(_('active'), '-last_activity_at', _("Most <strong>recently updated</strong> questions"))),
(_('newest'), pagination.SimpleSort(_('newest'), '-added_at', _("most <strong>recently asked</strong> questions"))),
(_('hottest'), HottestQuestionsSort(_('hottest'), _("most <strong>active</strong> questions in the last 24 hours</strong>"))),
(_('mostvoted'), pagination.SimpleSort(_('most voted'), '-score', _("most <strong>voted</strong> questions"))),
- ), pagesizes=(15, 30, 50), default_pagesize=default_pagesize, prefix=prefix)
+ ), pagesizes=pagesizes, default_pagesize=default_pagesize, prefix=prefix)
class AnswerSort(pagination.SimpleSort):
def apply(self, answers):
return objects.order_by('-is_active', self.order_by)\r
\r
class UserListPaginatorContext(pagination.PaginatorContext):\r
- def __init__(self):\r
+ def __init__(self, pagesizes=(20, 35, 60)):\r
super (UserListPaginatorContext, self).__init__('USERS_LIST', sort_methods=(\r
(_('reputation'), UserReputationSort(_('reputation'), '-reputation', _("sorted by reputation"))),\r
(_('newest'), pagination.SimpleSort(_('recent'), '-date_joined', _("newest members"))),\r
(_('last'), pagination.SimpleSort(_('oldest'), 'date_joined', _("oldest members"))),\r
(_('name'), pagination.SimpleSort(_('by username'), 'username', _("sorted by username"))),\r
- ), pagesizes=(20, 35, 60))\r
+ ), pagesizes=pagesizes)\r
\r
class SubscriptionListPaginatorContext(pagination.PaginatorContext):\r
def __init__(self):\r