It's still not quite clear what you want to do. Variables defined in models will be available in all views, regardless of what the action returns. Variables defined in controllers outside of functions will not be available in any views (unless explicitly returned by a controller function). locals() will include any variables defined locally within a given controller function. Can you provide a more detailed example of what you are trying to achieve?
Anthony On Sunday, May 24, 2015 at 3:21:29 AM UTC-4, Annet wrote: > > Thank you all for your replies. > > > Can you be more clear about what you're trying to do? Why doesn't the >> usual returning of a dictionary work in this case? >> > > The usual returning of a dictionary works. To limit the number of views I > designed an outer_layout and inner_layout and tried > to keep the other views as generic as possible. > > I moved the defintion of some variables to db.py or to the controller > outside any function, to prevent myself from starting a > function with defining variables the function itself does not need, but > one of the views does need. Some functions return > 10 + variables, so I thought that instead of putting them in a dictionary > it would be easier to do something like: > > def my_function(): > .... > return function_vars() > > > Kind regards, > > Annet > -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.

