当前位置: 首页>>代码示例>>Python>>正文


Python Page.create方法代码示例

本文整理汇总了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)
开发者ID:racktivity,项目名称:ext-pylabs-core,代码行数:9,代码来源:ConfluenceImpl.py

示例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)
开发者ID:racktivity,项目名称:ext-pylabs-core,代码行数:10,代码来源:ConfluenceImpl.py

示例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)
开发者ID:racktivity,项目名称:ext-pylabs-core,代码行数:10,代码来源:ConfluenceImpl.py

示例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)))
开发者ID:racktivity,项目名称:ext-pylabs-core,代码行数:10,代码来源:ConfluenceImpl.py

示例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)
开发者ID:racktivity,项目名称:ext-pylabs-core,代码行数:14,代码来源:ConfluenceImpl.py

示例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)
开发者ID:racktivity,项目名称:ext-pylabs-core,代码行数:14,代码来源:ConfluenceImpl.py

示例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')
开发者ID:UniqueLJH,项目名称:yinongShop,代码行数:31,代码来源:manager.py


注:本文中的model.Page.create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。