routes_in = (
  ("/user/$username", "/welcome/user/view/$username"),
)

routes_out = (
  ("/welcome/user/view/$username", "/user/$username"),
)

On Oct 1, 11:48 am, Francisco Costa <[email protected]> wrote:
> I would like to improve my users urls by cutting the 'view' function
> out so the url would behttp://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"),
>   ("/welcome/(.+)", r"/\1"),
> )
>
> The thing is that I have more functions in the user control and they
> don't work unless I add a route for each of those functions.
>
> On Oct 1, 5:25 pm, Jonathan Lundell <[email protected]> wrote:
>
> > 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 <[email protected]> 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 Costa <[email protected]> wrote:
>
> > >>> is it possible?
>
> > >>> On Oct 1, 10:55 am, Francisco Costa <[email protected]> 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: /welcome/user/index is a list of all users and only works if I
> > >>>> had
>
> > >>>> routes_in:  ("/user/index", r"/welcome/user/index"),
> > >>>> routes_out:   ("/welcome/user/index", r"/user/index"),
>
> > >>>> My question is, if there is any way that you don't have to route every
> > >>>> function, and only the view/user
>
> > >>>> On Sep 30, 3:19 pm, Wikus van de Merwe <[email protected]>
> > >>>> wrote:
>
> > >>>>> 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")
> > >>>>> )
>
>

Reply via email to