you need to pass it

return dict(t1=t1)

or

return locals()

http://zerp.ly/rochacbruno
Em 05/01/2012 12:03, "Peter O" <peter.k.ocon...@gmail.com> escreveu:

> Hihi,
>
> I am baffled by what I see between Example 1 and 2.
>
> It may be a good case to improve my understanding of the run-time
> environment of web2py.
>
> Thanks in advance for any comments.
>
> VIEW: (test.html)
>
> <html>  <body>
> {{=globals().get('t1', False)}}
>  </body> </html>
>
> CONTROLLER:
>
> == Example 1 ==
>
> def test():
>     global t1
>     t1 = True
>     return dict() # the browser show 'False'. I was expecting 'True'
>
> == Example 2 ==
>
> def test():
>     global t1
>     t1 = True
>
>     response.render('default/test.html', globals() ) #the return is
> discarded
>
>     return dict() # the browser show 'True'. I was expecting the same
> result as Example 1.
>
>
>
>
>
>

Reply via email to