def get(self): p = self.GET.get("p") p = int(p) if p and p.isdigit() else 1 pager = Post.fetch_page(p, func=INDEXPOSTFILTER) context = {"pager": pager} self.render("index.html", context)
def get(self): p = self.GET.get("p") p = int(p) if p and p.isdigit() else 1 pager = Post.fetch_page(p, func=ADMINPOSTFILTER) context = {"page_name": u"文章管理", "page_title": u"文章管理", "pager": pager } self.render("admin_post.html", context)
def get(self, category_key_name): p = self.GET.get("p") p = int(p) if p and p.isdigit() else 1 cate = Key.from_path("Category", category_key_name) if not cate: #TODO 404 pass pager = Post.fetch_page(p, func=lambda x:x.filter("category =", cate).filter("status =", PostStatus.NORMAL).order("-date_created"), realtime_count=True) context = {"pager": pager} self.render("index.html", context)