當前位置: 首頁>>代碼示例>>Python>>正文


Python JSONSearch.IJSONSearch類代碼示例

本文整理匯總了Python中Products.TinyMCE.adapters.interfaces.JSONSearch.IJSONSearch的典型用法代碼示例。如果您正苦於以下問題:Python IJSONSearch類的具體用法?Python IJSONSearch怎麽用?Python IJSONSearch使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了IJSONSearch類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: jsonLinkableSearch

    def jsonLinkableSearch(self, searchtext):
        """Returns the search results of linkable objects in JSON"""

        utility = getToolByName(aq_inner(self.context), 'portal_tinymce')
        linkable_portal_types = utility.linkable.split('\n')
        linkable_portal_types.extend(utility.containsobjects.split('\n'))

        object = IJSONSearch(self.context, None)
        if object is None:
            return ''
        results = object.getSearchResults(linkable_portal_types, searchtext)
        return results
開發者ID:Goldmund-Wyldebeast-Wunderliebe,項目名稱:Products.TinyMCE,代碼行數:12,代碼來源:browser.py

示例2: jsonSCEmbedderSearch

    def jsonSCEmbedderSearch(self, searchtext):
        """Returns the search results of sc.embedder objects in JSON"""

        utility = getUtility(ITinyMCE)
        portal_types = ["sc.embedder"]
        portal_types.extend(utility.containsobjects.split("\n"))

        object = IJSONSearch(self.context, None)
        if object is None:
            return ""
        results = object.getSearchResults(portal_types, searchtext)
        return results
開發者ID:abstract-open-solutions,項目名稱:sc.embedder,代碼行數:12,代碼來源:views.py

示例3: jsonImageSearch

    def jsonImageSearch(self, searchtext):
        """Returns the search results of image objects in JSON"""

        utility = getUtility(ITinyMCE)
        image_portal_types = utility.imageobjects.split('\n')
        image_portal_types.extend(utility.containsobjects.split('\n'))

        object = IJSONSearch(self.context, None)
        if object is None:
            return ''
        results = object.getSearchResults(image_portal_types, searchtext)
        return results
開發者ID:chrigl,項目名稱:Products.TinyMCE,代碼行數:12,代碼來源:browser.py

示例4: jsonImageSearch

    def jsonImageSearch(self, searchtext):
        """Returns the search results of image objects in JSON"""

        utility = getToolByName(aq_inner(self.context), "portal_tinymce")
        image_portal_types = utility.imageobjects.split("\n")
        image_portal_types.extend(utility.containsobjects.split("\n"))

        object = IJSONSearch(self.context, None)
        if object is None:
            return ""
        results = object.getSearchResults(image_portal_types, searchtext)
        return results
開發者ID:sgeulette,項目名稱:Products.TinyMCE,代碼行數:12,代碼來源:browser.py

示例5: test_json_search

    def test_json_search(self):
        # Create an Event
        self.portal.invokeFactory('Event', id='events', title='Events')

        # The json search is used the look for content types within the self.portal. Let's see
        # if we can find some items containing the searchterm 'Events'
        linkable_portal_types = self.utility.linkable.split('\n')
        linkable_portal_types.extend(self.utility.containsobjects.split('\n'))

        obj = IJSONSearch(self.portal)
        self.assertRegexpMatches(
            obj.getSearchResults(filter_portal_types=linkable_portal_types,
            searchtext='Events',
        ), '\{.*"title": "Events", "url": "http://nohost/plone/events".*}')
開發者ID:chrigl,項目名稱:Products.TinyMCE,代碼行數:14,代碼來源:test_adapters.py


注:本文中的Products.TinyMCE.adapters.interfaces.JSONSearch.IJSONSearch類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。