[web2py] Re: shorting your URL with routes

2010-10-02 Thread Francisco Costa
Thank you Jonathan and Wikus. I only have a few functions in the users controller so I will list them like Wikus showed. I appreciate all your help. On Oct 2, 1:00 am, Jonathan Lundell wrote: > On Oct 1, 2010, at 9:48 AM, Francisco Costa wrote: > > > > > > > I would like to improve my users urls

Re: [web2py] Re: shorting your URL with routes

2010-10-01 Thread Jonathan Lundell
On Oct 1, 2010, at 9:48 AM, Francisco Costa wrote: > > I would like to improve my users urls by cutting the 'view' function > out so the url would be http://domain.com/user/username > > Now I have this: > > routes_in = ( > ("/user/(.+)", r"/welcome/user/view/\1"), > ("/(.+)", r"/welcome/\1"),

[web2py] Re: shorting your URL with routes

2010-10-01 Thread Wikus van de Merwe
Massimo, this will still change "http://domain.com/welcome/user/index"; to "http://domain.com/welcome/user/view/index"; instead of "http:// domain.com/user/index". Francisco, if I were you, with more functions in the controller, I wouldn't do any url shortening and simply stay with /user/view/. Be

[web2py] Re: shorting your URL with routes

2010-10-01 Thread mdipierro
routes_in = ( ("/user/$username", "/welcome/user/view/$username"), ) routes_out = ( ("/welcome/user/view/$username", "/user/$username"), ) On Oct 1, 11:48 am, Francisco Costa wrote: > I would like to improve my users urls by cutting the 'view' function > out so the url would behttp://domain.

[web2py] Re: shorting your URL with routes

2010-10-01 Thread Francisco Costa
I would like to improve my users urls by cutting the 'view' function out so the url would be http://domain.com/user/username Now I have this: routes_in = ( ("/user/(.+)", r"/welcome/user/view/\1"), ("/(.+)", r"/welcome/\1"), ) routes_out = ( ("/welcome/user/view/(.+)", r"/user/\1"), ("/w

Re: [web2py] Re: shorting your URL with routes

2010-10-01 Thread Jonathan Lundell
On Oct 1, 2010, at 9:20 AM, Francisco Costa wrote: > > Has I said before, that way other functions of the controller user > don't work Can you list, more or less, what you're after? > :( > > > On Oct 1, 3:10 pm, mdipierro wrote: >> yes >> >> routes_in = ( >> ("/user/(.+)", r"/welcome/user/

[web2py] Re: shorting your URL with routes

2010-10-01 Thread Francisco Costa
Has I said before, that way other functions of the controller user don't work :( On Oct 1, 3:10 pm, mdipierro wrote: > yes > > routes_in = ( >   ("/user/(.+)", r"/welcome/user/view/\1"), > ) > > routes_out = ( >   ("/welcome/user/view/(.+)", r"/user/\1"), > ) > > On Oct 1, 8:57 am, Francisco Cos

[web2py] Re: shorting your URL with routes

2010-10-01 Thread mdipierro
yes routes_in = ( ("/user/(.+)", r"/welcome/user/view/\1"), ) routes_out = ( ("/welcome/user/view/(.+)", r"/user/\1"), ) On Oct 1, 8:57 am, Francisco Costa wrote: > is it possible? > > On Oct 1, 10:55 am, Francisco Costa wrote: > > > Thank you for your answers, both work for me, i didn't k

[web2py] Re: shorting your URL with routes

2010-10-01 Thread Francisco Costa
is it possible? On Oct 1, 10:55 am, Francisco Costa wrote: > Thank you for your answers, both work for me, i didn't know that the > order was important. > But the thing is that I have others functions in the user controller > that stopped to work, unless I have a dedicated route for them. > ex: /

[web2py] Re: shorting your URL with routes

2010-10-01 Thread Francisco Costa
Thank you for your answers, both work for me, i didn't know that the order was important. But the thing is that I have others functions in the user controller that stopped to work, unless I have a dedicated route for them. ex: /welcome/user/index is a list of all users and only works if I had rout

[web2py] Re: shorting your URL with routes

2010-09-30 Thread Wikus van de Merwe
You mean this doesn't work for you? routes_in = ( ("/user/(.+)", r"/welcome/user/view/\1"), ("/(.+)", r"/welcome/\1") ) routes_out = ( ("/welcome/user/view/(.+)", r"/user/\1"), ("/welcome/(.+)", r"/\1") )

[web2py] Re: shorting your URL with routes

2010-09-30 Thread mdipierro
routes_in = ( ('/user/(?P.*)', '/welcome/user/view/\g'), ('/(?P.*)', '/welcome/\g'), ) routes_out = ( ('/welcome/user/view/(?P.*)', '/user/\g'), ('/welcome/(?P.*)', '/\g'), ) the order is important . On Sep 30, 4:47 am, Francisco Costa wrote: > Hello! > I have this urlhttp://domain.com/

[web2py] Re: shorting your URL with routes

2010-09-30 Thread Francisco Costa
any thoughts on this one? On Sep 30, 12:57 pm, Francisco Costa wrote: > Hello Wikus, tx for your answer. > > It only works if I don't have the previous routes that cut the > 'welcome' application. > > Can you make it work with bouth? > > I wouldn't like to show the application name in the others

[web2py] Re: shorting your URL with routes

2010-09-30 Thread Francisco Costa
Hello Wikus, tx for your answer. It only works if I don't have the previous routes that cut the 'welcome' application. Can you make it work with bouth? I wouldn't like to show the application name in the others controllers/ functions urls. On Sep 30, 11:57 am, Wikus van de Merwe wrote: > Try

[web2py] Re: shorting your URL with routes

2010-09-30 Thread Wikus van de Merwe
Try this: routes_in = ( ("/user/(.+)", r"/welcome/user/view/\1"), } routes_out = ( ("/welcome/user/view/(.+)", r"/user/\1)"), }