Ticket #2075: list_detail.patch

File list_detail.patch, 965 bytes (added by kanashii@…, 18 years ago)
  • list_detail.py

     
    44from django.core.paginator import ObjectPaginator, InvalidPage
    55from django.core.exceptions import ObjectDoesNotExist
    66
    7 def object_list(request, queryset, paginate_by=None, allow_empty=False,
     7def object_list(request, queryset, paginate_by=None, page=None, allow_empty=False,
    88        template_name=None, template_loader=loader,
    99        extra_context={}, context_processors=None, template_object_name='object',
    1010        mimetype=None):
     
    3737    queryset = queryset._clone()
    3838    if paginate_by:
    3939        paginator = ObjectPaginator(queryset, paginate_by)
    40         page = request.GET.get('page', 1)
     40        if not page:
     41            page = request.GET.get('page', 1)
    4142        try:
    4243            page = int(page)
    4344            object_list = paginator.get_page(page - 1)
Back to Top