本文整理汇总了Python中page.Page.new方法的典型用法代码示例。如果您正苦于以下问题:Python Page.new方法的具体用法?Python Page.new怎么用?Python Page.new使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类page.Page
的用法示例。
在下文中一共展示了Page.new方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: admin_new
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import new [as 别名]
def admin_new():
if request.method == 'POST':
name = request.forms.name.lower().strip()
try:
Validator.check_name(name)
name = urllib.quote_plus(name)
d = datetime.now()
name = d.strftime('%Y-%m-%d-') + name
p = Page(name)
p.new(d)
redirect('/admin/edit/%s' % name)
except PageError, e:
return template('admin_new', msg=str(e))
示例2: __create_home_page
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import new [as 别名]
def __create_home_page(cls, acct):
home_page_title = 'Home'
home_page_text = 'Welcome to hypertextual. This is your home page.'
home_page = Page.new(acct, home_page_title)
home_page.slug = '__home'
home_page.save_draft_rev(home_page_text, True)
home_page.publish_draft_rev()
示例3: __create_private_home_page
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import new [as 别名]
def __create_private_home_page(cls, acct):
private_home_page_title = 'Private Home'
private_home_page_text = 'Welcome to hypertextual. This is your private home page.'
private_home_page = Page.new(acct, private_home_page_title)
private_home_page.slug = '__private'
private_home_page.private = True
private_home_page.save_draft_rev(private_home_page_text, True)
private_home_page.publish_draft_rev()
示例4: new_page
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import new [as 别名]
def new_page(self, title):
page = Page.new(self, title)
return page