Пример #1
0
  def get(self):
    phone = self.request.get('phone')
    message = self.request.get('message')

    self.response.headers['Content-Type'] = 'text/plain'
    if not message:
      self.response.out.write('missing message')
      return

    post = Post()
    post.message = message
    post.put()
		
    self.response.out.write(message)
Пример #2
0
    def post(self):
        subject = self.request.get('subject')
        content = self.request.get('content')

        if subject and content:
            a = Post(title = subject, article = content)
            a.put()
            id = a.key().id()
            sleep(0.1)
            memcache.set(str(id), a)
            st['p'] = time.time()
            self.redirect('/blog/%d' % id, id)
        else:
            error = 'We need both title and article!'
            self.write_art(subject, content, error)