I am working on a network app, in which I use the same controllers and views for all hubs. To keep them separated all hubs have an id and every hub function start with test_hub_vars:
def test_hub_vars(): if not len(request.args): redirect(URL('default','error')) elif request.args(0)==1: redirect(URL('default','index')) else: if not (session.hubnetworkID and session.hubword and session.hubcontroller_menu): init_hubvars(request.args(0)) elif session.hubnetworkID != request.args(0): init_hubvars(request.args(0)) def init_hubvars(networkID): session.hubnetworkID=networkID row=db(db.NetworkKeyword.networkID==request.args(0)).select(db.NetworkKeyword.word).first() if row: session.hubkeyword=row.word else: redirect(URL('default','error')) session.hub_header_top=URL('static','init/images/hub/ hub_header_top.jpg') This almost works. The exception is the redirect to the default index function in this case: http://127.0.0.1:8000/init/hubaddressbook/index/1 the test_hub_vars function should redirect to http://127.0.0.1:8000/init/default/index which it doesn't do. I cannot figure out why this doesn't work. Kind regards, Annet