Wednesday, September 7, 2011

Re: Pagination of more than one field

On 7 September 2011 14:57, OC <sagios@gmail.com> wrote:
Thank you very much for your reply,
I changed it but I guess Im doing something wrong cause it still
doesnt work:
It tries to go to the right page now, but provides nothing although I
know there's more than one page:

in views.py
movies_page= int(request.GET.get('page','1'))
   try:
       moviesp = movpaginator.page(movies_page).......

in the template:
     {% if actors.has_previous %}
                               <a href="?
movies_page={{ actors.previous_page_number }}"><img
src="{{ MEDIA_URL }} images/preview.png"></a>
                       {% else %}


You're setting the movies_page request parameter in the URL you're generating, but you're reading the *page* request parameter in the view function.

Change to "movies_page = int(request.GET.get('movies_page', 1))" and it should work

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment