Depends on the context of fullrender, if you create in only once in your
application, then its ok.
But if you want to do this in every request, then I think it is a bad idea.
On Saturday, November 10, 2012 7:34:43 PM UTC+4, Dexter wrote:
>
> Is it unpythonic or unwepyish if I set a variable I need in base layout in
> template_globals and pass it like this
> fullrender =
> web.template.render('templates/',base='menu',globals=template_globals)
>
> Cheers
> PK
>
>
>
>
>> 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/-/YNZOeX_vShkJ.
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.