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


Python SitemapNavtreeStrategy.decoratorFactory方法代码示例

本文整理汇总了Python中Products.CMFPlone.browser.navtree.SitemapNavtreeStrategy.decoratorFactory方法的典型用法代码示例。如果您正苦于以下问题:Python SitemapNavtreeStrategy.decoratorFactory方法的具体用法?Python SitemapNavtreeStrategy.decoratorFactory怎么用?Python SitemapNavtreeStrategy.decoratorFactory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Products.CMFPlone.browser.navtree.SitemapNavtreeStrategy的用法示例。


在下文中一共展示了SitemapNavtreeStrategy.decoratorFactory方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: update

# 需要导入模块: from Products.CMFPlone.browser.navtree import SitemapNavtreeStrategy [as 别名]
# 或者: from Products.CMFPlone.browser.navtree.SitemapNavtreeStrategy import decoratorFactory [as 别名]
    def update(self):
        query = self.request.get('q', None)
        self.tab = self.request.get('tab', None)
        b_size = 10
        page = int(self.request.get('page', 0))
        strategy = SitemapNavtreeStrategy(self.context)

        uids = None
        if self.tab == 'content-tree':
            # XXX: not implemented
            pass
#            portal_state = getMultiAdapter((self.context, self.request),
#                                           name=u'plone_portal_state')
#            portal = portal_state.portal()
#            query_tree = {'sort_on': 'getObjPositionInParent',
#                          'sort_order': 'asc',
#                          'is_default_page': False}
#            strategy.rootPath = portal.absolute_url_path()
#            data = buildFolderTree(portal,
#                                   obj=portal,
#                                   query=query_tree,
#                                   strategy=strategy)
#            result = data.get('children', [])
        else:
            if self.tab == 'clipboard':
                # XXX: not implemented
                pass
#                brains = list(self.search(''))[:2]
#                uids = [b.UID for b in brains]
            result = self.search(query, uids=uids,
                                 b_start=page * b_size,
                                 b_size=b_size)
            result = [strategy.decoratorFactory({'item': node}) for node in result]
        self.level = 1
        self.children = result
开发者ID:digitalnatif,项目名称:collective.cover,代码行数:37,代码来源:screenlets.py

示例2: update

# 需要导入模块: from Products.CMFPlone.browser.navtree import SitemapNavtreeStrategy [as 别名]
# 或者: from Products.CMFPlone.browser.navtree.SitemapNavtreeStrategy import decoratorFactory [as 别名]
 def update(self):
     query = self.request.get('q', None)
     self.tab = self.request.get('tab', None)
     uids = None
     if self.tab == 'recent':
         pass
     elif self.tab == 'clipboard':
         brains = list(self.search(''))[:2]
         uids = [b.UID for b in brains]
     result = self.search(query, uids=uids)
     strategy = SitemapNavtreeStrategy(self.context)
     result = [strategy.decoratorFactory({'item': node}) for node in result]
     if self.tab == 'content-tree':
         portal_state = getMultiAdapter((self.context, self.request),
                                           name=u'plone_portal_state')
         portal = portal_state.portal()
         query_tree = {'sort_on': 'getObjPositionInParent',
                       'sort_order': 'asc',
                       'is_default_page': False}
         strategy.rootPath = '/Plone'
         data = buildFolderTree(portal,
                            obj=portal,
                            query=query_tree,
                            strategy=strategy)
         result = data.get('children', [])
     self.level = 1
     self.children = result
开发者ID:cintiacinquini,项目名称:collective.cover,代码行数:29,代码来源:screenlets.py

示例3: update

# 需要导入模块: from Products.CMFPlone.browser.navtree import SitemapNavtreeStrategy [as 别名]
# 或者: from Products.CMFPlone.browser.navtree.SitemapNavtreeStrategy import decoratorFactory [as 别名]
    def update(self):
        self.query = self.request.get("q", None)
        self.tab = self.request.get("tab", None)
        b_size = int(self.request.get("b_size", 10))
        page = int(self.request.get("page", 1))
        strategy = SitemapNavtreeStrategy(self.context)

        uids = None
        result = self.search(self.query, uids=uids, page=page, b_size=b_size)
        self.has_next = result.has_next
        self.nextpage = result.nextpage
        result = [strategy.decoratorFactory({"item": node}) for node in result]
        self.level = 1
        self.children = result
开发者ID:jsbueno,项目名称:collective.cover,代码行数:16,代码来源:contentchooser.py

示例4: update

# 需要导入模块: from Products.CMFPlone.browser.navtree import SitemapNavtreeStrategy [as 别名]
# 或者: from Products.CMFPlone.browser.navtree.SitemapNavtreeStrategy import decoratorFactory [as 别名]
    def update(self):
        self.query = self.request.get('q', None)
        self.tab = self.request.get('tab', None)
        page = int(self.request.get('page', 1))
        strategy = SitemapNavtreeStrategy(self.context)

        uids = None
        result = self.search(
            self.query, uids=uids,
            page=page
        )
        self.has_next = result.next is not None
        self.nextpage = result.pagenumber + 1
        children = [strategy.decoratorFactory({'item': node}) for node in result]
        self.level = 1
        self.children = children
开发者ID:jean,项目名称:collective.cover,代码行数:18,代码来源:contentchooser.py


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