當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。