I have the following class definition:
class TestHandler(webapp2.RequestHandler):
def get(self):
self.msg = "hello world"
self.render_form() # modifies self.msg
def post(self):
print self.msg
#...
#...
#...
self.render_form()
When running, I get the following error:
File "/Users/mhalsharif/Desktop/wordsnet1/ascii-chan/main.py", line 129, in post print self.msg AttributeError: 'AnswersHandler' object has no attribute 'msg'
I am simply trying to save a string in the 'msg' attribute and print it when post() is called. Why cannot I do that? and how to fix it?