You can do what you are talking about via routes.py.

I believe this will do it:
routes_in=(
           ('/yourapp/default/$f.html','/yourapp/$f'),
           )




On Apr 7, 12:44 pm, g-man <gregor...@gmail.com> wrote:
> I am learning all the new auth, crud, and mail tools now, and I have
> one question:
>
> Does web2py use the 'default' controller as an implicit global
> controller across a single application, or is that even possible?
>
> Here is my situation. When I create my:
>
> ## default.py controller
> def user():
>     return dict(form = auth())
>
> Then I expose:
>
> ## request
> application/default/user/login
>
> Which is not as clean in terms of MVC, because I in effect have an
> additional (virtual) controller (named 'user') created, which then
> calls the function 'login'.
>
> Ideally, I would like:
>
> ## request
> application/user/login
>
> ...to expose the function, which would require treating 'default' as a
> global controller, as it were. I tried creating a 'login' controller,
> but the request still required an extra term in the request (app/login/
> user/login) - not pretty.
>
> I hate to say Rails does something like this with the 'application'
> controller, because any code in that file is global to the app.
>
> I guess what I am looking for is web2py to look in the 'default'
> controller first if any parsed controller/function candidate can not
> be found, and only then raise the error on failure.
>
> That way we can have a simpler request syntax (more RESTful), and the
> result would be a good fit in the case of auth, crud, and mail,
> because these are usually site-wide administrative functions anyway.
>
> Programming is fun again, thanks to web2py!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to