On Thursday, March 31, 2011 12:24:59 PM UTC-4, VP wrote: 
>
>
> Hyphen/dash is a minus sign.  You can't define a Python variable or 
> function that has a hyphen/dash.  It's syntactically incorrect.  I do 
> not think it's web2py's place to automatically fix this syntactical 
> error.

 
Note, web2py is not correcting a syntax error. web2py expects your 
controller functions to obey proper Python syntax and not include any 
hyphens. But it assumes that when you include underscores in an app, 
controller, or function name that you want those underscores converted to 
hyphens in outgoing URLs (that's a reasonable assumption, as it is a 
preferred standard for URLs). It therefore also assumes that when an 
incoming URL includes hyphens, those must map to underscores in the matching 
app, controller, and function names, because the names would not be legal 
Python names with hyphens.
 
I guess the problem is that you *can* include hyphens in app names (as you 
have) without (necessarily) violating any Python syntax, so if your app name 
includes hyphens, the router mistakenly thinks the hyphens in the app name 
in incoming URLs should be mapped to underscores.
 
Anthony

Reply via email to