1👍
✅
First off, your variable names versus how you describe everything is quite confusing.
The issue is you are using two different variables for the page: n
for person
(or comment
) and page
for house
(or posts). In each of your <a href="">
you need to set both n
and page
not just one. So:
<a class="Link" href= "{% if formula %}?text={{formula}}&{% else %}?{% endif %}page={{ posts.previous_page_number }}&n={{ comment.number }}">newer entries << </a>
<a class="Link" href="{% if formula %}?text={{formula}}&{% else %}?{% endif %}page={{ posts.next_page_number }}&n={{ comment.number }}"> >> older entries</a>
<a class="Link" href= "?n={{ comment.previous_page_number }}&page={{ posts.number }}">newer entries << </a>
<a class="Link" href="?n={{ comment.next_page_number }}&page={{ posts.number }}"> >> older entries</a>
0👍
In the same view you change the value of paginator
two times
paginator = Paginator(comment, 5)
# here you have code that does stuff and some lines below
paginator = Paginator(posts, 5)
if you want two paginators in the same view you should also name them differently (and add them to your context variables)
Something I can suggest is to have an ajax pagination view that you’re going to call to switch between pages in your templates. In this way, you can change page to each resultset separately without needing to reload the entire view (and probably loosing your pagination state)
- [Answer]-How to implement composition/agregation with NDB on GAE
- [Answer]-Django link multiple tables
- [Answer]-Use existing html page elements (its form and button) withing django app
- [Answer]-Twitter Bootstrap not displaying in Template
- [Answer]-Python3 SqlAlchemy error TypeError: Type str doesn't support the buffer API
Source:stackexchange.com