]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/views/users.py
Some fixes around pagination.
[osqa.git] / forum / views / users.py
index e6abdc488987f70694d8b989b043f253783d3ccd..8441f96dd64fd1b169753d0007fcfa9127f29af2 100644 (file)
@@ -35,13 +35,13 @@ class UserReputationSort(pagination.SimpleSort):
         return objects.order_by('-is_active', self.order_by)\r
 \r
 class UserListPaginatorContext(pagination.PaginatorContext):\r
         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
         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
 \r
 class SubscriptionListPaginatorContext(pagination.PaginatorContext):\r
     def __init__(self):\r