This is not an option in web2py because the controller is executed
after the requests arrives not imported before (as in Flask). Anyway,
that works better for simple apps but becomes a mess if you have many
functions because the routing info is scattered all over the place.
Moreover - when it comes to rest - it requires that you use the same
function for multiple methods (GET/POST/etc) by using multiple
decorators or that you use different functions with different names to
handle different names (I do not like that).

On Mar 22, 3:13 am, Tom Atkins <minkto...@gmail.com> wrote:
> I might be being naive here but in Flask I can do:
>
> @app.route('/<yoursitename>/users')
> ... def editusers(yoursitename): pass
>
> print url_for('editprofile', yoursitename='Supersite')
>
> gives:
>
> /Supersite/users
>
> On 22 March 2011 05:23, Jonathan Lundell <jlund...@pobox.com> wrote:
>
>
>
>
>
>
>
> > On Mar 21, 2011, at 7:44 PM, Indra Gunawan wrote:
>
> > Agree, Flask way looks more elegant (see Variable Rules). It could be nice
> > if this way also exists on Web2Py.
>
> > On 22 March 2011 06:05, Tom Atkins <minkto...@gmail.com> wrote:
>
> >> I was playing with Flask and I have to say its solution to routing is very
> >> nice:
>
> >>http://flask.pocoo.org/docs/quickstart/#routing
>
> >> The use of variable names anywhere within the URL structure is very handy.
> >> Anything like this possible in web2py?
>
> > Flask doesn't really allow variable names anywhere; near as I can tell
> > they're a considerably restricted version of web2py's args list.

Reply via email to