# HG changeset patch # User Sylvain Thénault # Date 1253555048 -7200 # Node ID 1003a6f3d2989864ddb49923763b757f659da740 # Parent 2ea19d969a2d82b4c943591b65d3acb3075b254f [schema sync] fix so that new cardinality are considered when both inlined and cardinality change in the same transaction diff -r 2ea19d969a2d -r 1003a6f3d298 entities/schemaobjs.py --- a/entities/schemaobjs.py Mon Sep 21 18:49:38 2009 +0200 +++ b/entities/schemaobjs.py Mon Sep 21 19:44:08 2009 +0200 @@ -63,14 +63,18 @@ * raise ValidationError if inlining is'nt possible * eventually return True """ - rtype = self.name - rschema = self.schema.rschema(rtype) + rschema = self.schema.rschema(self.name) if inlined == rschema.inlined: return False if inlined: - for (stype, otype) in rschema.iter_rdefs(): - card = rschema.rproperty(stype, otype, 'cardinality')[0] + # don't use the persistent schema, we may miss cardinality changes + # in the same transaction + for rdef in self.reverse_relation_type: + card = rdef.cardinality[0] if not card in '?1': + rtype = self.name + stype = rdef.stype + otype = rdef.otype msg = self.req._("can't set inlined=%(inlined)s, " "%(stype)s %(rtype)s %(otype)s " "has cardinality=%(card)s")