Exemplo n.º 1
0
    def GET(self):
        user = utils.getuser_by_cookie()
        if user is None :
            raise web.seeother('/')
        if user['admin']==0:
            raise web.seeother('/')

        blogs,page = Page.get_blogs_by_page(user['name'])
        return render.manage(blogs=blogs,page=page,user=user)
Exemplo n.º 2
0
    def GET(self):
        user = utils.getuser_by_cookie()
        if user is None :
            raise web.seeother('/')
        if user['admin']==0:
            raise web.seeother('/')

        blogs,page = Page.get_blogs_by_page(user['name'])
        for blog in blogs:
            blog['content'] = markdown2.markdown(blog['content'])
        #自定义字典
        #{'blogs':blogs,'blog':blog}
        # d = {'blogs':blogs,'page':page}

        return {'blogs':blogs,'page':page}