我有这个问题https:/www.reddit.comrdjangocomments52vmygpagination_with_search但我需要列出多个搜索词,而不是将1个搜索词传递给我的分页链接。
例如
<a class="page-link" href="?status={{ request.GET.status }}&page={{ page_obj.next_page_number }}">Next</a>
工作正常,但我需要放入多个对象,害怕模板代码会变得不可读,有什么方法可以让我用通用的for循环访问request.GET项目吗?
或者也许有更好的方式来编写分页代码
找到了,使用{{ request.get_full_path }}就能在我的模板中得到我需要的信息。