Proposal for application routes.py

4 views
Skip to first unread message

Robin B

unread,
Jan 8, 2009, 1:27:17 AM1/8/09
to web2py Web Framework
Proposal: if web2py/applications/*/routes.py exists, then it is joined
with web2p/routes.py if any, and the app may rewrite the sections
after the app name, (controller, function, args, kwargs).

This would be useful for building rich/restful urls:

/api/blogs/11/posts/22/comments.xml

While this can be accomplished already with web2py/routes.py, the fact
is that an application like this will not work with out creating/
modifying the global routes.py (bad), by checking for per-app routes,
apps can define nice routes that work with or without web2py/
routes.py.

This would allow apps to have isolated customization without modifying
or even requiring the use of global routes.

It would be backwards compatible!

Thoughts?

Robin

mdipierro

unread,
Jan 8, 2009, 8:23:00 AM1/8/09
to web2py Web Framework
I can see problems with this. But it may work. If you have a patch,
let me look at it.

Massimo

Yarko Tymciurak

unread,
Jan 8, 2009, 10:16:04 AM1/8/09
to web...@googlegroups.com
this has been on my list of things I want (or think maybe I want) for ... a while.

Basically, I couldn't justify an sqldesigner app because of two things - one of them being
the global routes which sqldesigner seems to (really) need for at least 2 purposes.

This kind of admin / helper app would then require routes.py at a global level for every
installation, which just isn't acceptable.

The second problem (Massimo) that sqldesigner showed, which I haven't thought of yet:
- the 3rd party (sqldesigner)  static source contains a link to it's own documentation / help
within that static tree, and the generated link always fails (the implicit "index.html" for the
directory is omitted from the link).  Historically, this is common enough practice in static web pages
that we should think about how to accomodate this in web2py.

It will be important for porting static pages to dynamic web2py use - all static
should work first, then pieces replaced w/ dynamic functionality - so this last part
seems like a basic pre-requisite.

Thoughts?

Yarko

P.S. - Robin - let me know if you start on a patch for routes;  I may eventually, but will announce on list if / when I start work on it; my todo list is a mile high, so it may be a while.
Reply all
Reply to author
Forward
0 new messages