3.6 api update stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 18 Feb 2010 13:28:38 +0100
branchstable
changeset 4633 a85b4361fb22
parent 4632 8ac40462bad0
child 4634 b2a3232783f8
3.6 api update
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)