def post(self):
     text = self.request.get('text')
     if text:
         conver_url = utils.unescape(self.request.get('url'))
         conver = Conver.get_for_url(conver_url)
         message = Message(author=PermaUser.get_current_permauser(), text=text, conver=conver)
         message.put()
         self.distribute_message(message)
         
     else:
         logging.error("No message '%S'saved for %s", text, conver_url)
 def get(self):
     permauser = PermaUser.get_current_permauser()
     conver_url = utils.unescape(self.request.get('url'))
     conver = Conver.get_for_url(conver_url)
     messages = Message.all().filter('conver =', conver).order('created').fetch(1000)
     self.response.out.write(template.render(
         os.path.join(os.path.dirname(__file__),
         'templates/conver.html'), 
         {
             'token': channel.create_channel(permauser.user_id() + str(conver.key().id_or_name())),
             'conver_url': conver_url,
             'messages': [ {'author': message.author.display_name(), 'text': message.text} for message in messages],
             'loginorout_text': 'Log out',
             'loginorout_url': users.create_logout_url(self.request.uri)
         }
     ))
 def post(self):
     conver_url = utils.unescape(self.request.get('url'))
     conver = Conver.get_for_url(conver_url)
     permauser = PermaUser.get_current_permauser()
     conver.remove_watcher(permauser)
     conver.put() # or maybe we want to keep all watchers forever, so people get notified about what they looked at
 def post(self):
     conver_url = utils.unescape(self.request.get('url'))
     conver = Conver.get_for_url(conver_url)
     permauser = PermaUser.get_current_permauser()
     conver.add_watcher(permauser)
     conver.put()