Server restart! I'm not sure if this is documented somewhere but I never did find it. Restarted my service and all is working perfectly fine (speaking of which, the dashes work fine - the translation to underscores must be *way* behind the scenes).
Thanks for all the help! On Mar 10, 1:01 pm, Michael Wales <evicera...@gmail.com> wrote: > Changing the - to _ inroutes.py(and of course, altering the data in > the table, to correspond) still results in an "invalid function" > error. > > I want to say myroutes.pyisn't being seen/used at all! For instance, > routes_out doesn't seem to be doing anything either. This line doesn't > rewrite any of the URL() calls that you would think it should: > routes_out = (('.*:/shooterhero/default/index', '/shooterhero')) > > My routes file is C:\web2py\routes.pyand web2py is running as a > service. > > On Mar 10, 11:27 am, mdipierro <mdipie...@cs.depaul.edu> wrote: > > > I think the problem is that web2py does not '-' in URL and replaces > > them with '_'. the replacement should happen after the URL mapping and > > before your action is called. Your actions sees "quake_like" instead > > of "quake-live". Does this help? > > > Massimo > > > On Mar 10, 10:08 am, Michael Wales <evicera...@gmail.com> wrote: > > > > Yeah, that's exactly how my app is setup at the moment (this is in > > > controllers/games.py): > > > > def view(): > > > sqlGame = db(db.games.slug == request.args[0]).select() > > > game = sqlGame[0] > > > sqlPeople = db((db.games_people.game_id == game.id) & > > > (db.games_people.person_id == db.people.id)).select() > > > sqlCompanies = db((db.companies_games.game_id == game.id) & > > > (db.companies_games.company_id == db.companies.id)).select() > > > > response.title = game.title + ' - ' + response.title > > > return dict(game = game, people = sqlPeople, companies = > > > sqlCompanies) > > > > The method in the controller is fine, as visiting /shooterhero/games/ > > > view/quake-live works as expected. > > > > I also tried changing "quake-live" to "quake" within the routes - just > > > for testing purposes. With "quake-live" I get an "Invalid request" > > > error, with "quake" I get an "invalid function" error. > > > > On Mar 10, 10:50 am, mdipierro <mdipie...@cs.depaul.edu> wrote: > > > > > You are mapping into > > > > > '/shooterhero/games/view/quake-live' > > > > > this assumes you app is called shooterhero > > > > your controller is called games.py > > > > your controller contains an action > > > > > def view(): > > > > .... > > > > > which parses "quake-live" from request.args[0] > > > > > Is this really what your app does? If not, how is the action called? > > > > > On Mar 10, 7:56 am, Michael Wales <evicera...@gmail.com> wrote: > > > > > > No luck - I've tried virtually every combination of with/without > > > > > escaping the dash, with/without the catch-all from the request domain > > > > > and with/without the application's subdirectory. > > > > > > Maybe someone has aroutes.pyfile they can share that I can review? > > > > > > On Mar 9, 11:11 pm, mdipierro <mdipie...@cs.depaul.edu> wrote: > > > > > > > I think the problem is that - musy be escaped \- > > > > > > You do not need the .*: > > > > > > > On Mar 9, 7:00 pm, Michael Wales <evicera...@gmail.com> wrote: > > > > > > > > I've created aroutes.pywith the following (yes, these will become > > > > > > > RegEx, but I am just trying to get it to work at this point): > > > > > > > > routes_in = (('.*:/shooterhero/games/quake-live', > > > > > > > '/shooterhero/games/ > > > > > > > view/quake-live')) > > > > > > > > My thinking is, if I link to /shooterhero/games/quake-live/ it > > > > > > > will > > > > > > > send this request to the games controller, view function, with > > > > > > > quake- > > > > > > > live as args[0] - unfortunately, I get an "Invalid request" error. > > > > > > > > I know it must be something simple I am overlooking - I've tried > > > > > > > with/ > > > > > > > without the application directory, same results. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---