common/entity.py
branch3.0
changeset 476 62968fa8845c
parent 475 b32a5772ff06
child 478 49dfd0bb422c
equal deleted inserted replaced
475:b32a5772ff06 476:62968fa8845c
  1000         if _done is None:
  1000         if _done is None:
  1001             _done = set()
  1001             _done = set()
  1002         _done.add(self.eid)
  1002         _done.add(self.eid)
  1003         containers = tuple(self.e_schema.fulltext_containers())
  1003         containers = tuple(self.e_schema.fulltext_containers())
  1004         if containers:
  1004         if containers:
       
  1005             yielded = False
  1005             for rschema, target in containers:
  1006             for rschema, target in containers:
  1006                 if target == 'object':
  1007                 if target == 'object':
  1007                     targets = getattr(self, rschema.type)
  1008                     targets = getattr(self, rschema.type)
  1008                 else:
  1009                 else:
  1009                     targets = getattr(self, 'reverse_%s' % rschema)
  1010                     targets = getattr(self, 'reverse_%s' % rschema)
  1010                 for entity in targets:
  1011                 for entity in targets:
  1011                     if entity.eid in _done:
  1012                     if entity.eid in _done:
  1012                         continue
  1013                         continue
  1013                     for container in entity.fti_containers(_done):
  1014                     for container in entity.fti_containers(_done):
  1014                         yield container
  1015                         yield container
       
  1016                         yielded = True
       
  1017             if not yielded:
       
  1018                 yield self
  1015         else:
  1019         else:
  1016             yield self
  1020             yield self
  1017                     
  1021                     
  1018     def get_words(self):
  1022     def get_words(self):
  1019         """used by the full text indexer to get words to index
  1023         """used by the full text indexer to get words to index