How do I paginate ?

506 views
Skip to first unread message

avi

unread,
Feb 3, 2014, 12:57:11 PM2/3/14
to python-...@googlegroups.com
Is there any module or support in Tornado for pagination? I have a Mongo DB containing 100 or so posts. I want to display 20 per page. How do I achieve this?

Johann Diedrick

unread,
Feb 3, 2014, 1:14:12 PM2/3/14
to python-...@googlegroups.com
I created a simple pagination using this site for reference: http://codular.com/implementing-pagination

I then implemented it in Tornado. Here is my sample handle for news:


And here's an example of what your template would render:


Hope it helps :)


On Mon, Feb 3, 2014 at 12:57 PM, avi <avinas...@gmail.com> wrote:
Is there any module or support in Tornado for pagination? I have a Mongo DB containing 100 or so posts. I want to display 20 per page. How do I achieve this?

--
You received this message because you are subscribed to the Google Groups "Tornado Web Server" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-tornad...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Aliane Abdelouahab

unread,
Feb 3, 2014, 6:40:27 PM2/3/14
to python-...@googlegroups.com
a hack i did to paginate (follow where the variable is):
https://github.com/abdelouahabb/essog/blob/master/handlers.py#L33

2014-02-03 Johann Diedrick <jdie...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages