Yes you can pass session to template globals and use it in templates. But everything stored in session will be saved between requests. If you need it only during particular request then you should store data in web.ctx.
On Wednesday, October 31, 2012 5:15:56 PM UTC+4, Dexter wrote: > > > > On Monday, 29 October 2012 21:44:15 UTC+5:30, Andrey Kuzmin wrote: >> >> Only if you init render without base and access layout directly like >> this: render.layout(render.page(**page_args), **layout_args) >> >> Another option would be enabling access to web.ctx in templates by >> passing it in template globals and then set ctx properties in your >> controller methods. >> > > This second method sounds good ... So is it only globals that the template > can have access to ? > Cant I access session parameters ? > > like set the option in session.options and access it inside template. I > know I can check this instead of asking ... just wanted to know if this is > a preferred method of doing thing ? > > -- You received this message because you are subscribed to the Google Groups "web.py" group. To view this discussion on the web visit https://groups.google.com/d/msg/webpy/-/g2Vuuopp2VsJ. 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/webpy?hl=en.
