def post(self): # Store the message in the data store. message = models.Message(parent=models.messages_key()) message.message = self.request.get('message') message.put() # Redirect back to the home page. self.redirect('/')
def get(self): messages_query = models.Message.query( ancestor=models.messages_key()).order(-models.Message.date) messages = messages_query.fetch() template_values = { 'messages': messages, } self.write_template('home.html', template_values)