diff gpp/shoutbox/views.py @ 243:7ddd60164245

For #93: remove the page number from the URL. This commit fixes the shoutbox and member list. It also contains a change to downloads to add pagination to the new, popular, and highest rated views.
author Brian Neal <bgneal@gmail.com>
date Thu, 16 Sep 2010 01:06:43 +0000
parents e1d1a70d312d
children
line wrap: on
line diff
--- a/gpp/shoutbox/views.py	Wed Sep 15 03:24:01 2010 +0000
+++ b/gpp/shoutbox/views.py	Thu Sep 16 01:06:43 2010 +0000
@@ -16,6 +16,7 @@
 
 from core.paginator import DiggPaginator
 from core.functions import email_admins
+from core.functions import get_page
 from shoutbox.forms import ShoutBoxForm
 from shoutbox.models import Shout
 from shoutbox.models import ShoutFlag
@@ -51,12 +52,13 @@
        context_instance = RequestContext(request))
 
 
-def view_history(request, page=1):
+def view_history(request):
     """This view allows one to view the shoutbox history."""
     paginator = DiggPaginator(Shout.objects.all().select_related(), 
             SHOUTS_PER_PAGE, body=5, tail=3, margin=3, padding=2)
+    page = get_page(request.GET)
     try:
-        the_page = paginator.page(int(page))
+        the_page = paginator.page(page)
     except InvalidPage:
         raise Http404