Exemple #1
0
    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)
Exemple #2
0
 def POST(self, id):
     post = reader.get_post_by_id(id)
     if post:
         writer.remove_post(post)
     web.redirect('/overview')