Exemplo n.º 1
0
    def post(self):
        sender = username = self.get_cookie("username")
        receiver = self.request.get("receiver")
        title = self.request.get("title")
        content = self.request.get("content")

        if receiver and title and content:
            msg = Message(sender=sender, receiver=receiver, title=title, content=content)
            msg.put()
            self.redirect("/")
        else:
            self.response.out.write("Error in Messages.post()")
Exemplo n.º 2
0
    def post(self):
        sender = username = self.get_cookie("username")
        receiver = self.request.get('receiver')
        title = self.request.get('title')
        content = self.request.get('content')

        if receiver and title and content:
            msg = Message(sender=sender,
                          receiver=receiver,
                          title=title,
                          content=content)
            msg.put()
            self.redirect('/')
        else:
            self.response.out.write("Error in Messages.post()")
Exemplo n.º 3
0
def captureMessage(a=None, b=None, c=None):
    '''
        Capture JSON messages between server and client
    '''
    Msg = Message(source=a, destination=b, content=c)
    Msg.put()