def post(self): content = self.request.post("content") key = self.request.post("key") if content and key: comment = Comment(content=content, timeslot=Timeslot.get(key)) comment.put() self.redirect(self.request.path)
def get(self): key = self.request.get('key') if key: timeslot = Timeslot.get(key) if timeslot: template = engine.jinja_environment.get_template('timetables/timeslot.html') template_values = engine.globals template_values["timeslot"] = timeslot template_values["comments"] = Comment.all().filter('timeslot =', timeslot) self.response.out.write(template.render(template_values)) else: print dir(self.request)
def get(self, key): template_values = engine.globals template_values['message'] = Timeslot.get(cgi.escape(key)) template = engine.jinja_environment.get_template('timetables/timeslot/show.html') self.response.out.write(template.render(template_values))