本文整理汇总了Python中models.Page.get_all_pages方法的典型用法代码示例。如果您正苦于以下问题:Python Page.get_all_pages方法的具体用法?Python Page.get_all_pages怎么用?Python Page.get_all_pages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Page
的用法示例。
在下文中一共展示了Page.get_all_pages方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from models import Page [as 别名]
# 或者: from models.Page import get_all_pages [as 别名]
def get(self):
user = self.authenticate_session_id()
pages = Page.get_all_pages()
if user:
self.render("home.html", user=user.username, pages=pages, page_titles=pages)
else:
self.render("home.html", pages=pages, page_titles=pages)
示例2: pages
# 需要导入模块: from models import Page [as 别名]
# 或者: from models.Page import get_all_pages [as 别名]
def pages(self):
""" edycja strona w panelu admina (z obsluga filtrow) """
slug_filter = self.request.params.get('slug','')
lang_filter = self.request.params.get('lang','')
pages = Page.get_all_pages(slug_filter=slug_filter, lang_filter=lang_filter)
assert all(p.lang for p in pages)
return self.render('admin/pages.html',
pages = pages,
slugs = Page.get_all_slugs_for_admin(),
langs = Page.get_all_langs_for_admin(),
slug_filter = slug_filter,
lang_filter = lang_filter)
示例3: render
# 需要导入模块: from models import Page [as 别名]
# 或者: from models.Page import get_all_pages [as 别名]
def render(self, template, page_titles=None, **kw):
if not page_titles:
page_titles = Page.get_all_pages()
self.write(self.render_str(template, page_titles=page_titles, **kw))