diff options
author | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2011-05-21 16:38:34 +0200 |
---|---|---|
committer | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2011-05-21 16:38:34 +0200 |
commit | 0e84c707cb57b864fff4bdd438644c4313677893 (patch) | |
tree | b91db8d0e855a51f4263c32c18f2b42f49901d4e /mediagoblin/util.py | |
parent | c0bf3c807b1e5a88238e551eaa1491b51af3914d (diff) | |
download | mediagoblin-0e84c707cb57b864fff4bdd438644c4313677893.tar.lz mediagoblin-0e84c707cb57b864fff4bdd438644c4313677893.tar.xz mediagoblin-0e84c707cb57b864fff4bdd438644c4313677893.zip |
Give Pagination.get_page_url() a request instead of path and GET
Makes calling Pagination.get_page_url() much simpler.
Diffstat (limited to 'mediagoblin/util.py')
-rw-r--r-- | mediagoblin/util.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mediagoblin/util.py b/mediagoblin/util.py index d37d160e..a1af7bd0 100644 --- a/mediagoblin/util.py +++ b/mediagoblin/util.py @@ -29,8 +29,6 @@ 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(): @@ -353,11 +351,13 @@ class Pagination(object): yield num last = num - def get_page_url(self, path_info, page_no, get_params=None): + def get_page_url(self, request, page_no): """ - Get a new page based of the path_info, the new page number, + Get a new page based of the request, the new page number, and existing get parameters. """ + path_info = request.path_info + get_params = request.GET new_get_params = copy.copy(get_params or {}) new_get_params['page'] = page_no return "%s?%s" % ( |