[ms] ensure owned_by/created_by can't be crossed among pyro-rql sources stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 03 Aug 2010 12:19:02 +0200
branchstable
changeset 6058 151b6b73acc6
parent 6057 cb5c8852cbda
child 6059 47f84adcd676
[ms] ensure owned_by/created_by can't be crossed among pyro-rql sources
server/sources/pyrorql.py
--- a/server/sources/pyrorql.py	Tue Aug 03 12:17:20 2010 +0200
+++ b/server/sources/pyrorql.py	Tue Aug 03 12:19:02 2010 +0200
@@ -131,8 +131,10 @@
         execfile(mappingfile, mapping)
         self.support_entities = mapping['support_entities']
         self.support_relations = mapping.get('support_relations', {})
-        self.dont_cross_relations = mapping.get('dont_cross_relations', ())
-        self.cross_relations = mapping.get('cross_relations', ())
+        self.dont_cross_relations = set(mapping.get('dont_cross_relations', ()))
+        self.cross_relations = set(mapping.get('cross_relations', ()))
+        self.dont_cross_relations.add('owned_by')
+        self.dont_cross_relations.add('created_by')
         baseurl = source_config.get('base-url')
         if baseurl and not baseurl.endswith('/'):
             source_config['base-url'] += '/'