Hello everybody,
 
I have an app with app specific routes and I have a function that allows 
any user to see a project by passing the project's owner username and the 
project's slug as args. I want the user to access the project just by 
www.domain.com/username/slug, not showing the function name, but it returns 
an 'invalid request' error when the slug contains hyphens.

*web2py/routes.py*



*#coding: utf-8routes_app = ((r'/(?P<app>admin)\b.*', r'\g<app>'),          
    (r'/(.*)', r'myapp'),              (r'/?(.*)', 
r'myapp'))myapp/routes.py*
#coding: utf-8

BASE = ''
routes_in = (
    (BASE + '/', BASE + '/myapp/panel/index'),
    (BASE + '/$username/$slug', BASE + 
'/myapp/panel/project/$username/$slug'),
    )

routes_out = [(x, y) for (y, x) in routes_in]

For instance, if I have a project called 'Test', it's slug is 'test' and 
it's URL is www.domain.com/julia/test. And this works! But if I have a 
project called 'My Test', it's slug is 'my-test' and it's URL is 
www.domain.com/julia/my-test, returning an invalid request.

Is there a way to solve this?


-- 
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/d/optout.

Reply via email to