removed request arg from Pagination class

added get_page_url() in Pagination class, to generate proper urls without losing
other get arguments
This commit is contained in:
Bernhard Keller
2011-05-19 20:37:04 +02:00
parent ca3ca51c5a
commit 44e3e917fb
5 changed files with 61 additions and 46 deletions

View File

@@ -33,9 +33,14 @@ def user_home(request):
.find({'uploader': user, 'state': 'processed'}) \
.sort('created', DESCENDING)
pagination = Pagination(2, cursor, request)
try:
page = int(request.str_GET['page'])
except KeyError:
page = 1
pagination = Pagination(cursor, page)
media_entries = pagination()
#if no data is available, return NotFound
if media_entries == None:
return exc.HTTPNotFound()