entities/adapters.py
branchstable
changeset 9433 dd708175dc43
parent 9130 0f1504a9fb51
child 9440 6880674c1a26
equal deleted inserted replaced
9432:030745ac9873 9433:dd708175dc43
   104             _done = set()
   104             _done = set()
   105         entity = self.entity
   105         entity = self.entity
   106         _done.add(entity.eid)
   106         _done.add(entity.eid)
   107         containers = tuple(entity.e_schema.fulltext_containers())
   107         containers = tuple(entity.e_schema.fulltext_containers())
   108         if containers:
   108         if containers:
   109             for rschema, target in containers:
   109             for rschema, role in containers:
   110                 if target == 'object':
   110                 if role == 'object':
   111                     targets = getattr(entity, rschema.type)
   111                     targets = getattr(entity, rschema.type)
   112                 else:
   112                 else:
   113                     targets = getattr(entity, 'reverse_%s' % rschema)
   113                     targets = getattr(entity, 'reverse_%s' % rschema)
   114                 for entity in targets:
   114                 for target in targets:
   115                     if entity.eid in _done:
   115                     if target.eid in _done:
   116                         continue
   116                         continue
   117                     for container in entity.cw_adapt_to('IFTIndexable').fti_containers(_done):
   117                     for container in target.cw_adapt_to('IFTIndexable').fti_containers(_done):
   118                         yield container
   118                         yield container
   119                         yielded = True
       
   120         else:
   119         else:
   121             yield entity
   120             yield entity
   122 
   121 
   123     # weight in ABCD
   122     # weight in ABCD
   124     entity_weight = 1.0
   123     entity_weight = 1.0