If the statement "test=session.test" is within a controller and outside all defs, then it is global to that controller, but that's all. It's not accessible to other controllers. It probably is visible to the controller's views -- you'll have to check to be sure. However, session.test is accessible to all controllers and views.
If the statement "test=session.test" is within a model, it will be global to all models that come after the statement and appear in files that are alphabetically after the model file that contains the statement. It will also be global to all controllers and views. I'm pretty sure the accuracy of the above statements, but you can easily test to verify. On Jun 30, 10:03 am, pk <peter.kirch...@youngdesigners.de> wrote: > ok thanks, and what can i do now with the variable test in the first > line. > can i use this now in every function in each controller? > > On 30 Jun., 15:12, mdipierro <mdipie...@cs.depaul.edu> wrote: > > > I think you want a session variable, not a global variable > > > test=session.test > > > def changingtest(): > > session.test = 5 > > return None > > > On 30 Giu, 07:42, pk <peter.kirch...@youngdesigners.de> wrote: > > > > hi together, > > > > i need help to solve this problem: i have a global variable in the > > > model like: > > > > test = None > > > > def changingtest(): > > > global test > > > test = 5 > > > return None > > > > how can i access to the variable test in every controllerfunction? > > > thanks for your fast help > > > > peter