# HG changeset patch # User Sylvain Thénault # Date 1266496118 -3600 # Node ID a85b4361fb225816c27208624582bd41d3de5295 # Parent 8ac40462bad08b4393031bea05ccad97c79ae35d 3.6 api update diff -r 8ac40462bad0 -r a85b4361fb22 server/migractions.py --- a/server/migractions.py Thu Feb 18 12:58:52 2010 +0100 +++ b/server/migractions.py Thu Feb 18 13:28:38 2010 +0100 @@ -664,7 +664,7 @@ self.cmd_add_attribute(etype, newname, attrtype, commit=True) # skipp NULL values if the attribute is required rql = 'SET X %s VAL WHERE X is %s, X %s VAL' % (newname, etype, oldname) - card = eschema.rproperty(newname, 'cardinality')[0] + card = eschema.rdef(newname).cardinality[0] if card == '1': rql += ', NOT X %s NULL' % oldname self.rqlexec(rql, ask_confirm=self.verbosity>=2) @@ -735,9 +735,9 @@ elif role == 'object': subjschema = tschema objschema = spschema - if (rschema.rproperty(subjschema, objschema, 'infered') + if (rschema.rdef(subjschema, objschema).infered or (instschema.has_relation(rschema) and - instschema[rschema].has_rdef(subjschema, objschema))): + (subjschema, objschema) in instschema[rschema].rdefs)): continue self.cmd_add_relation_definition( subjschema.type, rschema.type, objschema.type)