django basis (four) - paging component

A, django built pagination

django tab built using two classes: Paginator, Page 

The main methods and parameters are as follows:

Object #paginator 
the paginator Paginator = (L, 10) 

# per_page: Number of entries per page 
# count: Total number of data 
# num_pages: Pages 
# page_range: total number of pages in the index range, such as: (1, 10), (1,200) 
# Page: Page Object 

#page objects 
Posts = paginator.page (current_page) 
# is there has_next Next 
# next_page_number Next page 
whether there # has_previous Previous 
# previous_page_number Previous Page 
# object_list page after data list 
# number of the current page 
# paginator paginator objects

Guess you like

Origin www.cnblogs.com/hujinzhong/p/11598694.html