In > ('/(.*)', '/riffant/default/index/$1'), the (.*) is not named and therefore not set to $1. This is because of how web2py uses regex shortcuts. You can do instead ('/$anything', '/riffant/default/index/$anything'),
$anything is a catch-all shortcut. On Apr 14, 5:18 pm, Oatman <thelastanom...@gmail.com> wrote: > You're quite right, after messing around, I've fixed up a very simple > route that works with POST, as you suggest it would: > [...] > ('/new', '/riffant/default/new'), # works > [...] > > However, I still have a (hopefully) simple routing problem, the last > hurdle I hope before I update the GaE version (Thank you so much for > making it so easy to publish to gae BTW!). Here it is: > > My index controller is routed thusly: > ('/(.*)', '/riffant/default/index/$1'), > > and it uses the request.args(0) to get a single string as an arg, like > this "http://localhost:8000/stringgoeshere > However, with the above route, it never picks up the string, here's > the controller code: > > if request.args(0): > shortname = request.args(0) > try: > entry = db(db.email.shortname == shortname).select()[0] > except IndexError: > redirect(URL(r=request,f='index')) > response.title = entry.email > return dict(entry=entry,input=True) > else: > return dict(input=False) > > I've added the boolean "input" variable to confirm that > request.args(0) isn't being set (input is never true). > What am I doing wrong? > > Thanks, > Tris > > On Apr 14, 4:41 pm, mdipierro <mdipie...@cs.depaul.edu> wrote: > > > Routing does not affect post data so I do not think that is the > > problem. Can we see the form action, the generated html and the > > complete routes? > > > On Apr 14, 7:27 am, Oatman <thelastanom...@gmail.com> wrote:> Hi all, > > > > I'm having some real trouble finding out how to get forms to self- > > > submit successfully, when the URL they are on is re-routed using > > > routes.py. > > > > My app is called Riffant & I have a form running on / (/ is re-routed > > > to /riffant/default/index) which doesn't work using this config: > > > > routes_in = ( > > > ('/riffant/static/(.*)', '/riffant/static/$1'), > > > ('/(.*)', '/riffant/default/index/$1'), > > > ) > > > routes_out = ( > > > ('/riffant/default/index(?P<any>)', '/\g<any>'), > > > ('/riffant/(?P<any>)', '/\g<any>'), > > > ) > > > > I suspect it is because the POST data is not routed, but I couldn't > > > find an example of that outside the cryptic one in the official book: > > > [...] > > > ('140\.191\.\d+\.\d+:https://www.web2py.com:POST/(?P<any>.*)\.php', > > > [...] > > > > Any ideas? > > > > Many thanks, > > > Tris -- To unsubscribe, reply using "remove me" as the subject.