def get(self, path1, path2): id = util.parseint(path2, -1) cal = Calendar.get_by_id(id) if cal: values = { 'context':RequestContext(), 'menuItem':'home', 'cal':cal, } self.response.out.write(template.render('templates/home/calendar.html',values)) else: values = {'context':RequestContext()} self.response.set_status(404) self.response.out.write(template.render('templates/404.html',values))
def get(self, path1, path2): id = util.parseint(path2, -1) art = News.get_by_id(id) if art: values = { 'context':RequestContext(), 'menuItem':'home', 'art':art, } self.response.out.write(template.render('templates/home/detail.html',values)) else: values = {'context':RequestContext()} self.response.set_status(404) self.response.out.write(template.render('templates/404.html',values))