def post(self): if self.request.get('content') and users.get_current_user(): content = self.request.get('content') numchars = content.__len__() greeting = ChatDB() if numchars > 0 and numchars <= 200: greeting.author = users.get_current_user() greeting.content = content greeting.put() self.getChats(False)
def renderChats(self): greetings_query = ChatDB.all().order('-date') greetings = greetings_query.fetch(50) template_values = { 'greetings': greetings, } return self.generate('chats.html', template_values, lite = True)