[adapters] fix a name stomping error (entity)
Also give proper name to subject (role, not target),
and kill unused variable.
--- a/entities/adapters.py Mon Jan 13 15:17:11 2014 +0100
+++ b/entities/adapters.py Mon Jan 13 15:27:35 2014 +0100
@@ -106,17 +106,16 @@
_done.add(entity.eid)
containers = tuple(entity.e_schema.fulltext_containers())
if containers:
- for rschema, target in containers:
- if target == 'object':
+ for rschema, role in containers:
+ if role == 'object':
targets = getattr(entity, rschema.type)
else:
targets = getattr(entity, 'reverse_%s' % rschema)
- for entity in targets:
- if entity.eid in _done:
+ for target in targets:
+ if target.eid in _done:
continue
- for container in entity.cw_adapt_to('IFTIndexable').fti_containers(_done):
+ for container in target.cw_adapt_to('IFTIndexable').fti_containers(_done):
yield container
- yielded = True
else:
yield entity