Django

Code

Changeset 4591

Show
Ignore:
Timestamp:
02/25/07 22:53:44 (2 years ago)
Author:
jacob
Message:

Fixed #3170: added first_on_page and last_on_page arguments to paginated generic views. Thanks, Grimboy.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/views/generic/list_detail.py

    r4265 r4591  
    3434        hits 
    3535            number of objects, total 
     36        last_on_page 
     37            the result number of the last of object in the 
     38            object_list (1-indexed) 
     39        first_on_page 
     40            the result number of the first object in the 
     41            object_list (1-indexed) 
    3642    """ 
    3743    if extra_context is None: extra_context = {} 
     
    5864            'next': page + 1, 
    5965            'previous': page - 1, 
     66            'last_on_page': paginator.last_on_page(page - 1), 
     67            'first_on_page': paginator.first_on_page(page - 1), 
    6068            'pages': paginator.pages, 
    6169            'hits' : paginator.hits, 
  • django/trunk/docs/generic_views.txt

    r4420 r4591  
    753753    * ``previous``: The previous page number, as an integer. This is 1-based. 
    754754 
     755    * `last_on_page`: **New in Django development version** The number of the 
     756      last result on the current page. This is 1-based. 
     757 
     758    * `first_on_page`: **New in Django development version** The number of the 
     759      first result on the current page. This is 1-based. 
     760 
    755761    * ``pages``: The total number of pages, as an integer. 
    756762