colelloa / django-pagination

Automatically exported from code.google.com/p/django-pagination
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Paginate in view #77

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Trying to paginate in a view

What is the expected output? What do you see instead?
No pagination

What version of the product are you using? On what operating system?
django 1.3
django-pagination 1.0.5

Please provide any additional information below.
is it possible?

PD: Sorry for the format this issue, it is my first post here...

Original issue reported on code.google.com by jfo...@gmail.com on 10 Jan 2012 at 10:11

GoogleCodeExporter commented 8 years ago
ufff... sorry for the issue, I've solve the problem.

If you look at AutoPaginateNode doc in source code
http://code.google.com/p/django-pagination/source/browse/trunk/pagination/templa
tetags/pagination_tags.py#55

you see that you need paginator and page_obj

in the view:
...
paginator = Paginator(something_list, 10)
page = paginator.page(page) 
...
...
   #passing it to the template
   'paginator' : paginator,
   'page_obj' : page,

in template:

{% load pagination_tags %}
...
{% paginate %}

autopaginate is not necesary (You have done it in the view)

Thanks for this great proyect.

Original comment by jfo...@gmail.com on 10 Jan 2012 at 10:36