Exemple #1
0
 def addGreeting(self, gid, date, content):
     # to do
     greeting = Greeting(parent=guestbook_key(self.guestbook_name))
     greeting.gid = gid
     greeting.content = content
     #greeting.date=date
     greeting.put()
     return greeting.date
Exemple #2
0
  def post(self):
    greeting = Greeting()
    cont = self.request.get('content')
    if cont != "":
        if cont.lower().find("http") >= 0:
            self.response.out.write("<h4>Sorry, HTTP is not allowed in the comment.</h4>Use the Back button to return to the Guest Book.")
            return
        if users.get_current_user():
            greeting.author = users.get_current_user()

        greeting.content = cont
        greeting.put()
        self.redirect('/')
    else:
      self.response.out.write("<h4>Please enter a comment.</h4>Use the Back button to return to the Guest Book.")
Exemple #3
0
    def post(self):
        greeting = Greeting()
        cont = self.request.get('content')
        if cont != "":
            if cont.lower().find("http") >= 0:
                self.response.out.write(
                    "<h4>Sorry, HTTP is not allowed in the comment.</h4>Use the Back button to return to the Guest Book."
                )
                return
            if users.get_current_user():
                greeting.author = users.get_current_user()

            greeting.content = cont
            greeting.put()
            self.redirect('/')
        else:
            self.response.out.write(
                "<h4>Please enter a comment.</h4>Use the Back button to return to the Guest Book."
            )
 def addGreeting(self, content):
     greeting = Greeting()
     greeting.content = content
     greeting.put()