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 <[email protected]> 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 <[email protected]> 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 a routes.py file they can share that I can review?
>
> > On Mar 9, 11:11 pm, mdipierro <[email protected]> wrote:
>
> > > I think the problem is that - musy be escaped \-
> > > You do not need the .*:
>
> > > On Mar 9, 7:00 pm, Michael Wales <[email protected]> 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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to