most simple way to change the "page=" parameter in grids

56 views
Skip to first unread message

Thomas Wimmer

unread,
Sep 23, 2017, 3:05:46 PM9/23/17
to web2py-users
I use multiple sqlform.grids on my project.
On some i'd like to rename the "page=" argument to something else like "some=".

Probably the pattern-based routes.py could do this?

"routes_in = (
  ('/grid?some=2', '/examples/default/grid?page=2'),
)
routes_out = (
  ('/examples/default/grid?page=2', '/grid?some=2'),
)

Please help me with the regex (or any better solution)!

Thomas Wimmer

unread,
Sep 27, 2017, 3:29:21 AM9/27/17
to web2py-users
*push*

Nobody? No Idea at all?

Anthony

unread,
Sep 27, 2017, 12:34:50 PM9/27/17
to web2py-users
You're on the right track -- you would have to use the pattern-based rewrite system, as the "page" identifier is hard-coded in the grid code.

Thomas Wimmer

unread,
Sep 28, 2017, 2:26:17 AM9/28/17
to web2py-users
Thanks Anthony, i try and i try again.

At least you encourage me!
Reply all
Reply to author
Forward
0 new messages