コード例 #1
0
 def sourceAdded(self, catalog):
     queries = set()
     for token in catalog.getRelationTokens():
         additions = dict(
             (info['name'], catalog.getValueTokens(info['name'], token))
             for info in catalog.iterValueIndexInfo())
         queries.update(
             tuple(q.items())
             for q in self.getQueries(token, catalog, additions, {}, False))
     for q in queries:
         self._indexQuery(q)
コード例 #2
0
 def sourceAdded(self, catalog):
     queries = set()
     for token in catalog.getRelationTokens():
         additions = dict(
             (info['name'], catalog.getValueTokens(info['name'], token))
             for info in catalog.iterValueIndexInfo())
         queries.update(
             tuple(q.items()) for q in
             self.getQueries(token, catalog, additions, {}, False))
     for q in queries:
         self._indexQuery(q)
コード例 #3
0
 def sourceRemoved(self, catalog):
     # this only really makes sense if the getQueries/getValueTokens was
     # changed
     queries = set()
     for token in catalog.getRelationTokens():
         removals = dict(
             (info['name'], catalog.getValueTokens(info['name'], token))
             for info in catalog.iterValueIndexInfo())
         queries.update(
             tuple(q.items())
             for q in self.getQueries(token, catalog, {}, removals, True))
     for q in queries:
         self._indexQuery(q)
コード例 #4
0
 def sourceRemoved(self, catalog):
     # this only really makes sense if the getQueries/getValueTokens was
     # changed
     queries = set()
     for token in catalog.getRelationTokens():
         removals = dict(
             (info['name'], catalog.getValueTokens(info['name'], token))
             for info in catalog.iterValueIndexInfo())
         queries.update(
             tuple(q.items()) for q in
             self.getQueries(token, catalog, {}, removals, True))
     for q in queries:
         self._indexQuery(q)
コード例 #5
0
 def getQueries(relchain):
     if not relchain:
         yield query
         return
     if other is None:
         rels = relchain[-1]
     else:
         tokens = catalog.getValueTokens(other, relchain[-1])
         if not tokens:
             return
         rels = zc.relation.catalog.Any(tokens)
     res = BTrees.family32.OO.Bucket(static)
     res[name] = rels
     yield res
コード例 #6
0
ファイル: queryfactory.py プロジェクト: CGTIC/Plone_SP
 def getQueries(relchain):
     if not relchain:
         yield query
         return
     if other is None:
         rels = relchain[-1]
     else:
         tokens = catalog.getValueTokens(other, relchain[-1])
         if not tokens:
             return
         rels = zc.relation.catalog.Any(tokens)
     res = BTrees.family32.OO.Bucket(static)
     res[name] = rels
     yield res