コード例 #1
0
ファイル: admin.py プロジェクト: yibin001/pyblog
    def get(self, id):
        post = Post.get_post_by_id(id, ignorestatus=True)
        self.datamap['category'] = Category.get_categorys()
        self.datamap['tags'] = Tag.get_tags()

        self.datamap['post'] = post

        self.datamap['chose_tag'] = [x.tag for x in post.tag]
        self.datamap['chose_category'] = [x.category for x in post.category]
        self.write(render_admin.editpost(self.datamap))
コード例 #2
0
ファイル: endpoints.py プロジェクト: ltworf/DiveShare
    def get(self, tag):
        self.response.headers['Cache-Control'] = 'max-age=14400'
        if tag is None:
            #No tag selected
            tags = Tag.get_tags()
            template = templater.get_template('templates/tags.html')
            self.response.write(templater.render({'tags':tags}))
            return

        dives = Tag.get_dives(tag.lower())
        data = {'dives': dives,
                'tag': tag}

        # TODO use Etag and/or memcache

        template = templater.get_template('templates/tag.html')
        self.response.write(template.render(data))
コード例 #3
0
ファイル: admin.py プロジェクト: yibin001/pyblog
 def get(self):
     self.datamap['category'] = Category.get_categorys()
     self.datamap['tags'] = Tag.get_tags()
     self.write(render_admin.admin_newpost(self.datamap))