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))
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))
def get(self): self.datamap['category'] = Category.get_categorys() self.datamap['tags'] = Tag.get_tags() self.write(render_admin.admin_newpost(self.datamap))