Changeset - 076345298ef4
[Not reviewed]
0 1 0
Bradley Kuhn (bkuhn) - 9 years ago 2015-03-04 20:30:54
bkuhn@ebb.org
Allow additional arguments to listing() call.

The urls setup of old gave us various arguments at call time for
custom_index(), and some where useful. Hopefully, listing() can support
the same type of system, over time, once adapted. Here's an attempt to
get it started, first by supporting paginate_by.
1 file changed with 3 insertions and 2 deletions:
0 comments (0 inline, 0 general)
www/conservancy/apps/news/views.py
Show inline comments
...
 
@@ -20,3 +20,3 @@ class NewsListView(ListView):
 
                                    
 
def listing(request):
 
def listing(request, *args, **kwargs):
 
    news_queryset = PressRelease.objects.all()
...
 
@@ -29,3 +29,4 @@ def listing(request):
 

	
 
    paginator = Paginator(news_queryset, 6) # Show 6 news items per page
 
    paginate_by = kwargs.get('paginate_by', 6)  # Show 6 news items per page, by default
 
    paginator = Paginator(news_queryset, paginate_by)
 

	
0 comments (0 inline, 0 general)