+class UserReputationSort(pagination.SimpleSort):\r
+ def apply(self, objects):\r
+ return objects.order_by('-is_active', self.order_by)\r
+\r
+class UserListPaginatorContext(pagination.PaginatorContext):\r
+ def __init__(self):\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
+\r