本文整理匯總了Python中r2.lib.pages.PromotePage.render方法的典型用法代碼示例。如果您正苦於以下問題:Python PromotePage.render方法的具體用法?Python PromotePage.render怎麽用?Python PromotePage.render使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類r2.lib.pages.PromotePage
的用法示例。
在下文中一共展示了PromotePage.render方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: GET_edit_promo
# 需要導入模塊: from r2.lib.pages import PromotePage [as 別名]
# 或者: from r2.lib.pages.PromotePage import render [as 別名]
def GET_edit_promo(self, link):
if not link or link.promoted is None:
return self.abort404()
rendered = wrap_links(link, wrapper=promote.sponsor_wrapper, skip=False)
form = PromoteLinkForm(link, rendered)
page = PromotePage('new_promo', content=form)
return page.render()
示例2: GET_edit_promo
# 需要導入模塊: from r2.lib.pages import PromotePage [as 別名]
# 或者: from r2.lib.pages.PromotePage import render [as 別名]
def GET_edit_promo(self, link):
if not link or link.promoted is None:
return self.abort404()
rendered = wrap_links(link, skip=False)
form = PromoteLinkEdit(link, rendered)
page = PromotePage(title=_("edit sponsored link"), content=form, show_sidebar=False, extension_handling=False)
return page.render()
示例3: GET_edit_promo_cpm
# 需要導入模塊: from r2.lib.pages import PromotePage [as 別名]
# 或者: from r2.lib.pages.PromotePage import render [as 別名]
def GET_edit_promo_cpm(self, link):
if not link or link.promoted is None:
return self.abort404()
rendered = wrap_links(link, wrapper=promote.sponsor_wrapper,
skip=False)
form = PromoteLinkFormCpm(link=link,
listing=rendered,
timedeltatext="")
page = PromotePage('new_promo', content=form)
return page.render()