first I had trouble with the simple routing of a specific controller, e.g.
routes_in = (
('/myapp/client/list', '/myapp/client/view'),
)
it took sometime until I found out why this didn't work at all. I'm also
using the Parameter-based url rewrite system (routers = ...), but this
cannot be mixed with the Pattern-based system. It is mentioned in the book
but I just overlooked it. Wouldn't it be better if web2py would at least
show a warning message in case routers and routes_in are defined? (instead
of silently ignoring the defined routes_in)
so now I managed to redirect all my list controllers:
routes_in = (
('/$a/$c/list', '303->/$a/$c/view'),
)
I've got 2 issues left:
1. how can I preserve url parameters? e.g. /myapp/client/list?name=alex
should be redirected to /myapp/client/view?name=alex
currently the url parameters are lost.
2. since I can't use the pattern based system anymore, how can I define a
default application?
previously:
routers = dict(
BASE = dict(
default_application = 'myapp',
),
)
thanks for you help,
Alex
Am Samstag, 2. November 2013 13:15:37 UTC+1 schrieb Alex:
>
> since I found out that naming my controllers 'list' (to display all
> existing rows of a specific table) is not a good idea (because it
> overwrites the internal list type), I'd now like to rename all 'list'
> controllers to 'view'.
> To make the transitions for the users as smooth as possible all urls to a
> 'list' controller should be redirected to 'view'.
>
> e.g.
> /myapp/client/list -> /myapp/client/view
> /myapp/employee/list?status=active -> /myapp/employee/view?status=active
>
> I guess I need a routes_in in my routes.py but I'm not sure about the
> exact entry. For a specific url it should be easy:
> routes_in = (
> (BASE + '/myapp/client/list', '/myapp/client/view'),
> )
>
> I'm not so sure about the regular expression to define it for all urls. To
> redirect I need to write '303->' at the beginning, is that correct?
>
> Alex
>
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.