Only comments associated with the current page should be listed, so once again the query is modified to include the page ID. In this case, though, we also have to pass the pageid argument, which will in turn get passed to any h.url_for() calls in the paginator.
from http://pylonsbook.com/en/1.1/simplesite-tutorial-part-2.html
i cannot get this to work, the paginator does not pass things to the h.url_for, i followed the tutorial. i had to add pageid to the h.url_for in list.html. how do i solve?
part of the code:
${h.link_to(
comment.id,
h.url_for(
controller=u'comment',
action='view',
id=unicode(comment.id)
)
)}
but it does not work properly until i put in
${h.link_to(
comment.id,
h.url_for(
controller=u'comment',
action='view',
id=unicode(comment.id),
pageid = c.page.id
)
)}
edit: the problem is that on the tutorial it said that the paginator will pass through with this code:
c.paginator = paginate.Page(
comments_q,
page=int(request.params.get('page', 1)),
items_per_page=10,
pageid=c.page.id,
controller='comment',
action='list'
)
return render('/derived/comment/list.html')
but it does not happen unless I put it in manually