aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/util.py
diff options
context:
space:
mode:
authorBernhard Keller <keller_bernhard@web.de>2011-05-19 22:52:18 +0200
committerBernhard Keller <keller_bernhard@web.de>2011-05-19 22:52:18 +0200
commit3eb6fc4f2f2b0a41677ab88bdd941b79e3e87b39 (patch)
treefc639505538133a73809a0a231aa9f7665818016 /mediagoblin/util.py
parent44e3e917fbfc89409bac08d500c5a9246e0dc5f4 (diff)
downloadmediagoblin-3eb6fc4f2f2b0a41677ab88bdd941b79e3e87b39.tar.lz
mediagoblin-3eb6fc4f2f2b0a41677ab88bdd941b79e3e87b39.tar.xz
mediagoblin-3eb6fc4f2f2b0a41677ab88bdd941b79e3e87b39.zip
moved check for correct page values into decorator for view function
Diffstat (limited to 'mediagoblin/util.py')
-rw-r--r--mediagoblin/util.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/mediagoblin/util.py b/mediagoblin/util.py
index 9247ac19..5f5c59fb 100644
--- a/mediagoblin/util.py
+++ b/mediagoblin/util.py
@@ -29,6 +29,8 @@ from mediagoblin import globals as mgoblin_globals
import urllib
from math import ceil
import copy
+import decorators
+from webob import exc
TESTS_ENABLED = False
def _activate_testing():
@@ -298,11 +300,11 @@ def setup_gettext(locale):
class Pagination(object):
"""
Pagination class,
- initialization through __init__(self, page=1, per_page=2, cursor)
+ initialization through __init__(self, cursor, page=1, per_page=2):
get actual data slice through __call__()
"""
- def __init__(self, cursor, page=1, per_page=2):
+ def __init__(self, page, cursor, per_page=2):
"""
initializes Pagination
-- page, requested page