def GET(self, id=''): template_values = { 'site_info': self.site_info } path = os.path.join(os.path.dirname(__file__), 'tpl', 'writer') if (id): template_values['mode'] = 'edit' template_values['post'] = reader.get_post_by_id(id) else: template_values['mode'] = 'new' template_values['post'] = post() return template_render('write.html', path, template_values)
def POST(self, id): post = reader.get_post_by_id(id) if post: writer.remove_post(post) web.redirect('/overview')