Hello,

While trying to create a file out of the view, as well as display, I
realized a slightly confusing nature of response.render

sample code:

def generate_and_display():
    a = "1"
    b = "2"
    context = dict(a=a,b=b)
    message = response.render('display.html', context)
return dict(a=a, b=b,c=c)

In the above code, we can see the variable c with response._vars, but
cannot access it as it raised (NameError: name 'c'' is not defined)
( var a and b are accessible and visible). took me a while to figure
this confusing behavior was due to response.render. Either this should
not be the case, or be documented with bold.

Thanks

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.


Reply via email to