yield self if no ft container found 3.0
authorsylvain.thenault@logilab.fr
Tue, 27 Jan 2009 13:52:07 +0100
branch3.0
changeset 476 62968fa8845c
parent 475 b32a5772ff06
child 477 79eccee30049
yield self if no ft container found
common/entity.py
--- a/common/entity.py	Tue Jan 27 13:51:49 2009 +0100
+++ b/common/entity.py	Tue Jan 27 13:52:07 2009 +0100
@@ -1002,6 +1002,7 @@
         _done.add(self.eid)
         containers = tuple(self.e_schema.fulltext_containers())
         if containers:
+            yielded = False
             for rschema, target in containers:
                 if target == 'object':
                     targets = getattr(self, rschema.type)
@@ -1012,6 +1013,9 @@
                         continue
                     for container in entity.fti_containers(_done):
                         yield container
+                        yielded = True
+            if not yielded:
+                yield self
         else:
             yield self