fix infered rdef propagation
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 08 Dec 2009 19:16:56 +0100
changeset 4054 03c9a539d282
parent 4053 7cc66b1d9183
child 4055 03443dfb6fa4
fix infered rdef propagation
hooks/syncschema.py
--- a/hooks/syncschema.py	Tue Dec 08 07:54:51 2009 -0800
+++ b/hooks/syncschema.py	Tue Dec 08 19:16:56 2009 +0100
@@ -378,12 +378,15 @@
                       'description': rdef.description,
                       'cardinality': rdef.cardinality,
                       'constraints': rdef.constraints,
+                      'permissions': rdef.get_permissions(),
                       'order': rdef.order})
+        groupmap = group_mapping(session)
         for specialization in eschema.specialized_by(False):
-            if rschema.has_rdef(specialization, rdef.object):
+            if (specialization, rdef.object) in rschema.rdefs:
                 continue
-            for rql, args in ss.frdef2rql(rschema, str(specialization),
-                                          rdef.object, props):
+            sperdef = RelationDefinitionSchema(specialization, rschema, rdef.object, props)
+            for rql, args in ss.rdef2rql(rschema, str(specialization),
+                                         rdef.object, sperdef, groupmap=groupmap):
                 session.execute(rql, args)
         # set default value, using sql for performance and to avoid
         # modification_date update