Pagination in django - the original query string gets lost

前端 未结 4 885
慢半拍i
慢半拍i 2021-01-12 02:23

I use the code from the documentation to paginate the data:

try:
    data = paginator.page(request.GET.get(\'page\'))
except PageNotAnInteger:
    page = 1
          


        
4条回答
  •  盖世英雄少女心
    2021-01-12 03:01

    Similar to YPCrumble's answer, the following snippet works for me. But the template files could get pretty crowded when there are multiple parameters.

    {{ page }}
    

    Note that you must know the parameter names when apply this solution, so it may not fully satisfy your need.

提交回复
热议问题