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
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 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()