为Django准备的不错的分页器

django-rangepaginator的Python项目详细描述


这个django应用程序提供了一个templatetag来呈现分页小部件,其中包括当前活动页面周围的一系列页面。

docs/_static/example.png?stop-caching-me

状态

https://travis-ci.org/mvantellingen/django-rangepaginator.svg?branch=masterhttp://codecov.io/github/mvantellingen/django-rangepaginator/coverage.svg?branch=masterhttps://img.shields.io/pypi/v/django-rangepaginator.svg

安装

pip install django_rangepaginator

更新您的django设置:

INSTALLED_APPS+=['django_rangepaginator']# Use bootstrap4 templateRANGE_PAGINATOR_TEMPLATE='django_rangepaginator/bootstrap3.html'# Use bootstrap3 template (default)RANGE_PAGINATOR_TEMPLATE='django_rangepaginator/bootstrap4.html'

用法

{%loadrangepaginator%}{%paginatepagerequest=request%}

提供以下选项:

  • 距离:当前活动页面周围的页数(默认值=2)
  • 边:开始和结束处的页数(默认值=1)
  • 额外类:将额外的css类添加到分页div(默认值为“)
  • 文本标签:对上一个/下一个使用字符串,而不是符号(默认值为true)

演示

存储库中提供了沙盒环境,请运行以下命令:

./sandbox/manage.py migrate
./sandbox/manage.py runserver

错误/功能

告诉我!:-)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java使用并发hashmap减少线程池的内存使用?   java为什么在提交片段后出现错误“getParentActivityIntent:badActivity name”?   vim UltiSnips扩展java包   java给出了一个名称列表,如何插入、删除、显示、搜索和退出?Java程序   java Spring集成:只从FTP服务器下载新的或更新的文件?   使用Java中的Scala:将函数作为参数传递   java线程1每秒填充一个映射,线程2每60秒保存一个条目   java从私有类访问公共类中的方法/字段   如何使用ApacheSpark流媒体和JavaAPI从所有人那里获取英语推文?   java是否可以在父标记和子标记中编写XMLSchemainstance?   java无法读取文本文件,也找不到解决方案   java在运行时加载类时无法创建bean