To choose which view, put response.view="view.html"
in the 2 controllers that share the same view. And you need to return the same variables used for the view in both controllers. On Monday, August 20, 2018 at 4:44:29 AM UTC+8, lbjc...@gmail.com wrote: > > I have two controllers in an app. > One controller has functions that manage DAL tables and forms. The second > has imported module that are sometimes called. They both use one view. I > have tried to figure out ho to work this out but cant find ho to print > results to view from the second controller. With this arrangement, I keep > getting an error message: > > name 'conversations' is not defined > > > . My second controller has this code: > def conversations(): > row = db(db.post.author== auth.user.id).select(db.post.id, db.post. > convo, orderby=~db.post.id, limitby=(0,1)).first() > id = row.convo if row else None > return dict(id=id) > > > with the view.html > {{=conversations()}} > > I tried looking for an example, reference previous items related to this > and the only answer I got online is this > <https://stackoverflow.com/questions/28789074/web2py-with-multiple-controllers> > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.