Google App Engine python - Self is not defined -


I have a request that this class takes the map of ChatMsg into variable 3, username, roomname and msg. But it fails on this last line.

ChatMsg (webapp.RequestHandler): # this line gets 239 def (self): user name = urllib.unquote (self.request.get ('username')) roomname = urlib .unquote (self.request.get ('roomname')) # This line is 242

When he tries to assign to the roomnames, then it tells me: / P>

  & lt; Type 'Exception: Name Arrowroner': Name 'self' is not defined as Traceback (most recent call final): File "/base/data/home/apps/chatboxes/1.341998073649951735/ Chatroom.py", Line 23 9 , & Lt; Module & gt; Class ChatMsg (webapp.RequestHandler): File "/base/data/home/apps/chatboxes/1.341998073649951735/chatroom.py", line 242, ChatMsg in room name = urllib.unquote (self.request.get ('roomname') )  

What is happening to self-determination

This should be an indentation problem. Traceback shows that the error () is not in the method (you get the name Enter exception at the time of your class definition). Try to execute the following code, you will get the same exception as you have found.

  Class ChatMsg (object): # this line found 239DF (self): username = urlib quote (self.request.get ('username')) roomname = urllib.unquote (self .request.get ('roomname')) # this is row 242  

Comments