Detailed explanation :
- Blueprint This is flask The blueprint (blueprints) An organization of concepts , The management of multiple modules is more convenient
- get_page_parameter() The default value is page, That's the pagination number , What page is it
- users = User.find(...) This is to query specific data , Pay attention to pagination limit start, count This one
- pagination Paging object entity , Create objects based on core parameters
- page= What page is it now
- total= Total data
- bs_version= This is bootstrap Version number of , The default value is 2
- search= Is it a search , pagination.info When formatting, the copy will be different
- record_name= Show the copy pagination.info The value in
- render_template(...) Jinja2 Template formatting , The first parameter is the template location , And then there's the data
- users=users Parameters passed to the template , The list of data the page uses for iterations
- pagination=pagination Paging entity parameters
- pagination.info Display of the total amount of paging data
- pagination.links Display of a set of clickable pagination pages
CSS customized
.pagination-page-info {
padding: .6em;
padding-left: 0;
width: 40em;
margin: .5em;
margin-left: 0;
font-size: 12px;
}
.pagination-page-info b {
color: black;
background: #6aa6ed;
padding-left: 2px;
padding: .1em .25em;
font-size: 150%;
}
-
Data presentation : {{ pagination.info }}
-
Page number display : {{ pagination.links }}
-
Parameters : per_page The number of pages per page can be adjusted , Default 10/ page
-
Parameters : display_msg The data display template can be modified such as :
display_msg=' Exhibition {start}-{end} in total {total}'