Django Filter with Pagination

前端 未结 6 1278
梦谈多话
梦谈多话 2020-12-19 12:47

I\'m attempting to follow the following tutorial for pagination with django filters, but the tutorial seems to be missing something, and i\'m unable to get the pagination to

6条回答
  •  清歌不尽
    2020-12-19 13:21

    I don't know if this is relevant but it seems to me that the issue may be where you are setting the paginator. In your view you have

    paginator = Paginator(user_list.qs, 10)
    

    but if you look closely at the solutions provided they are suggesting that you should be using

    paginator = Paginator(user_list, 10) 
    

    ie without .qs as you've already defined user_list in a previous line with user_list = user_filter.qs

提交回复
热议问题