本文整理汇总了Python中model.Page.create方法的典型用法代码示例。如果您正苦于以下问题:Python Page.create方法的具体用法?Python Page.create怎么用?Python Page.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类model.Page
的用法示例。
在下文中一共展示了Page.create方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getPage
# 需要导入模块: from model import Page [as 别名]
# 或者: from model.Page import create [as 别名]
def getPage(self, id):
"""Return a Page object
@type id: string, or Page object
@param id: page id, or Page object
@rtype: Page"""
return Page.create(self.pm_getSpaceManager().getPage(self._unbox(id)), self._modelDataManager)
示例2: editPage
# 需要导入模块: from model import Page [as 别名]
# 或者: from model.Page import create [as 别名]
def editPage(self, page):
"""Update content of page
@type page: Page object
@param page: Page object having the updated content
@rtype: Page
@return: updated Page"""
return Page.create(self.pm_getSpaceManager().editPage(page.toDict()), self._modelDataManager)
示例3: findPage
# 需要导入模块: from model import Page [as 别名]
# 或者: from model.Page import create [as 别名]
def findPage(self, space, title):
"""Return a Page object
@type space: string, or Space object
@param space: space key, or Space object
@param title: the title of the page
@rtype: Page"""
return Page.create(self.pm_getSpaceManager().findPage(self._unbox(space), title), self._modelDataManager)
示例4: listPages
# 需要导入模块: from model import Page [as 别名]
# 或者: from model.Page import create [as 别名]
def listPages(self, space):
"""Return a list of available pages in this space
@type space: string, or Space Object
@param space: space key, or Space object
@rtype: Page list
@return: list of Pages contained in space"""
return tuple(Page.create(page, self._modelDataManager) for page in self.pm_getSpaceManager().listPages(self._unbox(space)))
示例5: createPageFromFile
# 需要导入模块: from model import Page [as 别名]
# 或者: from model.Page import create [as 别名]
def createPageFromFile(self, localFilePath, space, title = None, parentId = None, addFileAsAttachment = False):
"""Create a page and add the localFilePath path content as the page content
@param localPath: the path of the file on local machine containing the wiki text to be used as new page content
@type space: string , or Space object
@param space: space key, or Space object
@param title: page title(if default value, the file name will be used as a title)
@param parentId: the page id of the parent page (if default value, the page has no parent)
@param addFileAsAttachment: if True, the file specified is added as attachment to the page(if default value, no attachment is created)
@rtype: Page
@return: newly created Page"""
return Page.create(self.pm_getSpaceManager().createPageFromFile(localFilePath, self._unbox(space), title, parentId, addFileAsAttachment), self._modelDataManager)
示例6: addPage
# 需要导入模块: from model import Page [as 别名]
# 或者: from model.Page import create [as 别名]
def addPage(self, space, title, parent = None, content = ''):
"""Create a Page
@type space: string, or Space object
@param space: space key, or Space object
@param title: page title
@type parent: string, or Page object
@param parent: the page id of the parent page, or Page object of the parent page(if not passed the page has no parent)
@param content: page content written as wiki text
@rtype: Page
@return: newly created Page"""
return Page.create(self.pm_getSpaceManager().addPage(self._unbox(space), title, self._unbox(parent), content), self._modelDataManager)
示例7: syncdb
# 需要导入模块: from model import Page [as 别名]
# 或者: from model.Page import create [as 别名]
def syncdb():
from lib.util import find_subclasses
from model import db, User, Distribution, Category, Page
models = find_subclasses(db.Model)
for model in models:
if model.table_exists():
model.drop_table()
model.create_table()
logging.info('created table:%s' % model._meta.db_table)
Distribution.create(name = '免费配送', price = 0)
Distribution.create(name = '上门自提', price = 0)
Category.create(name = '积分商品', slug = 'credit', order = 1)
Category.create(name = '搭配购买', slug = 'acc', order = 2)
Category.create(name = '慕斯蛋糕', slug = 'mousse', order = 3)
Category.create(name = '巧克力蛋糕', slug = 'chocolate', order = 4)
Category.create(name = '乳酪蛋糕', slug = 'cheese', order = 5)
Category.create(name = '乳脂奶油蛋糕', slug = 'creambutter', order = 6)
Category.create(name = '冰淇淋蛋糕', slug = 'icecream', order = 7)
Page.create(name = '吉米的厨房', slug = 'aboutus', content = '')
Page.create(name = '包装展示', slug = 'bzzs', content = '')
Page.create(name = '订购说明', slug = 'dgsm', content = '')
Page.create(name = '如何收货', slug = 'rhsh', content = '')
Page.create(name = '付款方式', slug = 'fkfs', content = '')
Page.create(name = '配送范围', slug = 'psfw', content = '')
User.create(mobile = 'root', password = User.create_password('111111'), group = 9)
logging.info('superuser - username:root password:111111')