[ms] when entity is coming from an external source, don't add non final relations on complete stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 20 Aug 2010 08:16:03 +0200
branchstable
changeset 6124 c5900230809b
parent 6123 0d0a87e88281
child 6125 46b9cbbc1e37
[ms] when entity is coming from an external source, don't add non final relations on complete
entity.py
--- a/entity.py	Fri Aug 20 08:15:06 2010 +0200
+++ b/entity.py	Fri Aug 20 08:16:03 2010 +0200
@@ -712,7 +712,9 @@
             selected.append((attr, var))
         # +1 since this doen't include the main variable
         lastattr = len(selected) + 1
-        if attributes is None:
+        # don't fetch extra relation if attributes specified or of the entity is
+        # coming from an external source (may lead to error)
+        if attributes is None and self.cw_metainformation()['source']['uri'] == 'system':
             # fetch additional relations (restricted to 0..1 relations)
             for rschema, role in self._cw_to_complete_relations():
                 rtype = rschema.type