On 1 Feb 2013, at 12:18 PM, Massimo Di Pierro <[email protected]> 
wrote:
> You could also edit request.controller, request.function, and request.args 
> (if appropriate) in your model, if you're not using controller-specific 
> models at least.
> 
> I could see adding a case-normalizing option to the parametric router.
> 
> +1 

I've given this a little bit of thought.

There are two variations possible. The simplest, almost trivial, is to 
unconditionally lowercase all incoming app/controller/function names, with the 
implication that the actual names are also lowercase, and all outgoing URLs 
would be lowercase unless the developer explicitly set them otherwise.

More elaborate: allow mixed case in app/controller/function names, and 
normalize incoming URLs to match. The router would need lists of all possible 
names, which is problematical only for functions (since it already keeps lists 
of apps and controllers). The overhead needn't be too large: use the lowercased 
incoming name as a lookup key in a dict that mapped lowercase names to the 
"real" mixed-case names.

Massimo, it'd be a help, both for something like this and for the existing 
functionality of the router, if the functionality of regex_expose (roughly 
speaking) were made available through some external API. It'd be somewhat 
nontrivial for the case in which we have only the compiled application, since 
the function names would have to be inferred from the compiled filenames.

-- 

--- 
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/groups/opt_out.


Reply via email to