On Mar 22, 2011, at 1:14 AM, Tom Atkins wrote: > sorry - should have been: > > @app.route('/<yoursitename>/users') > ... def editusers(yoursitename): pass > > print url_for('editusers', yoursitename='Supersite') > > gives: > > /Supersite/users
Maybe so. Is there a formal definition of how Flask's routing works? All I could find was a rather brief overview at the quickstart link. > > On 22 March 2011 08:13, 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. > > >