Hi Cory, how you do this depends on details.
You can call one action from another action from within the same controller without problems. In this case you cannot pass parameters but they will see the same global variables (request, response, etc). You can define any function in a model or controller and call it from any action in that controller. In this case you can pass parameters. If you want to call an action from one controller from an action in another controller there are three ways: 1) make a separate http request 2) use exec_environment which "fakes" a separate http request but it is faster because does not go over network 3) don't. put the function in a module and import the module from both controllers. In many cases 3) is the most appropriate thing to do. but there is nothing wrong wth 2. Massimo On Dec 16, 11:03 pm, Cory Coager <[email protected]> wrote: > When I meant call functions I meant actions and I don't think you can > pass variables to actions, no? I did some more research and it looks > like I need to use exec_environment to call other actions. I can't > seem to figure out how to pass variables with this though. > > On Dec 16, 10:53 pm, Baron <[email protected]> wrote: > > > within the controller you can call other functions directly like > > normal Python! Did you try it? > > > On Dec 17, 12:58 pm, Cory Coager <[email protected]> wrote: > > > > How do you call a function from another function in a controller? And > > > how do you pass variables between them? The only way I can see how to > > > do this is using ajax but their must be a better way. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

