Count total search objects count in template using django-haystack

廉价感情. 提交于 2019-12-03 06:54:18
Francis Yaconiello

Haystack uses the standard django pagination: https://docs.djangoproject.com/en/dev/topics/pagination/

Showing {{ page.object_list|length }} of {{ page.paginator.count }} Results on Page {{ page.number }} of {{ page.paginator.num_pages }}

If you want to show the result range instead of page number, e.g. "Results 21-40 of 1001", You can do

Results {{ page.start_index }} - {{ page.end_index }} of {{ page.paginator.count }}
soField
{{ page.object_list | length }}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!