Exemplo n.º 1
0
def chat_post():
    chat = Chat(id=request.form['name'],
                name=request.form['name'],
                description=request.form['description'])
    chat.put()
    chat.send_congratulations_email_to(users.get_current_user())
    return redirect('/chats')
Exemplo n.º 2
0
    def post(self):

        author = users.get_current_user()
        author_ip = self.request.remote_addr
        artkeystr = self.request.get('articleId')
        artkey = db.Key(artkeystr.strip())
        text = self.request.get('text').strip()
        parentidstr = self.request.get('parentId')

        if parentidstr.strip() == '':
            parent_chat = None
            art = artkey
        else:
            parent_chat = Chat.get_by_id(int(parentidstr))
            art = None

        chat = Chat(author=author,
                    author_ip=author_ip,
                    art=art,
                    text=text,
                    parent_chat=parent_chat)

        if chat:
            chat.put()
            self.get(artkey.name())
        else:
            print 'Content-Type: text/plain'
            print ''
            print 'Failed'
Exemplo n.º 3
0
  def post(self):

    author = users.get_current_user()
    author_ip = self.request.remote_addr
    artkeystr = self.request.get('articleId')
    artkey = db.Key(artkeystr.strip())
    text = self.request.get('text').strip()
    parentidstr = self.request.get('parentId')

    if parentidstr.strip() == '':
      parent_chat = None
      art = artkey
    else:
      parent_chat = Chat.get_by_id(int(parentidstr))
      art = None

    chat = Chat(author=author,
                author_ip=author_ip,
                art=art,
                text=text,
                parent_chat=parent_chat)

    if chat:
      chat.put()
      self.get(artkey.name())
    else:
      print 'Content-Type: text/plain'
      print ''
      print 'Failed'