fix related_rql when target_type specified stable
authorAlexandre Fayolle <alexandre.fayolle@logilab.fr>
Thu, 15 Oct 2009 12:10:48 +0200
branchstable
changeset 3683 2e4794c97cf4
parent 3682 9b62c5887639
child 3684 c0a854810942
fix related_rql when target_type specified
entity.py
--- a/entity.py	Thu Oct 15 11:56:56 2009 +0200
+++ b/entity.py	Thu Oct 15 12:10:48 2009 +0200
@@ -695,14 +695,14 @@
             if targettypes is None:
                 targettypes = rschema.objects(self.e_schema)
             else:
-                restriction += 'E is IN (%s)' % ','.join(targettypes)
+                restriction += ', X is IN (%s)' % ','.join(targettypes)
             card = greater_card(rschema, (self.e_schema,), targettypes, 0)
         else:
             restriction = 'E eid %%(x)s, X %s E' % rtype
             if targettypes is None:
                 targettypes = rschema.subjects(self.e_schema)
             else:
-                restriction += 'E is IN (%s)' % ','.join(targettypes)
+                restriction += ', X is IN (%s)' % ','.join(targettypes)
             card = greater_card(rschema, targettypes, (self.e_schema,), 1)
         if len(targettypes) > 1:
             fetchattrs_list = []