That is correct; you can not use a hyphen in a python function name.
On 3/31/11 12:18 PM, VP wrote:
I am curious. I don't think people can define Python functions
(controllers) that have hyphens. Right? If their controllers can not
have hyphens, then why would web2py have to worry about mapping
hyphens to underscores in function names(which appears to have
undesirable side effects)?
On Mar 31, 10:06 am, Jonathan Lundell<[email protected]> wrote:
On Mar 30, 2011, at 11:35 PM, pbreit wrote:
Perhaps at least it can be fixed to accept hyphens in the app name? The only
problem is with function names, correct?
I'm pretty sure that controller names are a problem, too, and I'm not certain
about application names.
Function names are the most obvious problem, because they're directly used as
Python identifiers. But application and controller names get used in a variety
of ways (not just as file names), so I've been wary of allowing them.
The new router allows more than the old system did (even without the regex
router enabled).
If you want to experiment with it, in the new router you can redefine the
parameter acfe_match, which is used to validate a/c/f. By default it's r'\w+$';
try setting it to r'[\w\-]+$' instead, and be sure to set map_hyphen=False.
If you do experiment, be sure to try compiling an app and running the compiled
version.