# HG changeset patch # User Sverre Rabbelier # Date 1236864935 0 # Node ID 407000879987f253c1d5177d8392f433d6e269b4 # Parent 747b0d1115eae315f98d20201a24acc53b53d996 Allow developers to specify a higher limit for a list view Patch by: Sverre Rabbelier diff -r 747b0d1115ea -r 407000879987 app/soc/views/helper/lists.py --- a/app/soc/views/helper/lists.py Thu Mar 12 00:48:52 2009 +0000 +++ b/app/soc/views/helper/lists.py Thu Mar 12 13:35:35 2009 +0000 @@ -26,12 +26,14 @@ import itertools from soc.logic import dicts +from soc.logic.models.user import logic as user_logic import soc.views.helper.forms DEF_PAGINATION = 50 MAX_PAGINATION = 100 +MAX_DEV_PAGINATION = 1000 DEF_PAGINATION_CHOICES = ( ('10', '10 items per page'), @@ -85,7 +87,9 @@ offset = max(0, offset) limit = max(1, limit) - limit = min(MAX_PAGINATION, limit) + + maximum = MAX_DEV_PAGINATION if user_logic.isDeveloper() else MAX_PAGINATION + limit = min(maximum, limit) return limit, offset