python - flask-admin how to rewrite pagination
某草草
某草草 2017-05-18 10:53:56
0
1
556

There is a view that displays a log. I need to add some content to the paging URL. How can I rewrite the paging URL?

某草草
某草草

reply all(1)
滿天的星座

To rewrite paging, you need to rewrite lib.html in the admin in the template. Paging is generated by the macro pager (page, pages, generator) among them

He accepts the total number of pages and the current number of pages, and accepts a generator to generate the url. The key is to rewrite the generator he accepts

Track the generation of paging through index_view. In index_view, when everything is ready, render will render the template and return. Among the parameters of render, there is one called pager_url, and generator refers to him

When excluding page 0, the real generator is _get_list_url, so just rewrite the _get_list_url method

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!