is there a built in pagination option while using the crudcontroller (tg 2.1.4) : sprox etc?

20 views
Skip to first unread message

alonn

unread,
Dec 18, 2012, 6:53:09 AM12/18/12
to turbo...@googlegroups.com
wandering if I have to specifically override the get_all to do that, or can I just pass a some parameter to control the number of items in every page

Alessandro Molina

unread,
Dec 19, 2012, 5:15:37 AM12/19/12
to TurboGears .
You should be able to create a get_all method with @expose(inherit=True) that simply calls the super(MyClass, self).get_all() inside that method you can then tune the paginator parameters from tg.request.paginators. Simply changing the paginate_items_per_page property inside that dictionary should do what you are looking for.


On Tue, Dec 18, 2012 at 12:53 PM, alonn <alon...@gmail.com> wrote:
wandering if I have to specifically override the get_all to do that, or can I just pass a some parameter to control the number of items in every page

--
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To view this discussion on the web visit https://groups.google.com/d/msg/turbogears/-/H-I2ZrrOwt4J.
To post to this group, send email to turbo...@googlegroups.com.
To unsubscribe from this group, send email to turbogears+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/turbogears?hl=en.

Alessandro Molina

unread,
Dec 19, 2012, 5:16:42 AM12/19/12
to TurboGears .
Ah, forgot to mention that it will work only with TurboGears2.2 as it requires @expose(inherit=True) support.

alonn

unread,
Dec 19, 2012, 5:04:24 PM12/19/12
to turbo...@googlegroups.com
since I'm not using tg 2.2 but 2.1.4 is there a simple recommended upgrade path?

Michael Pedersen

unread,
Jan 3, 2013, 12:08:36 AM1/3/13
to tg-trunk
The upgrade path to go from 2.1 to 2.2 should be extremely easy, and I would expect things to just work for most everybody. Just upgrade TG in your dev installation, and run your nosetests to make sure nothing got broken that we didn't know about.


To view this discussion on the web visit https://groups.google.com/d/msg/turbogears/-/iH5Vcrww1YMJ.

To post to this group, send email to turbo...@googlegroups.com.
To unsubscribe from this group, send email to turbogears+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/turbogears?hl=en.



--
Michael J. Pedersen
My Online Resume: http://www.icelus.org/ -- Google+ http://plus.ly/pedersen
Google Talk: m.ped...@icelus.org -- Twitter: pedersentg
Reply all
Reply to author
Forward
0 new messages