yams 0.26 api update
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 23 Dec 2009 08:52:54 +0100
changeset 481 b19683747d74
parent 480 4025f1f02d1d
child 483 c39da0ebf38a
yams 0.26 api update
nodes.py
stcheck.py
--- a/nodes.py	Thu Oct 15 20:20:29 2009 +0200
+++ b/nodes.py	Wed Dec 23 08:52:54 2009 +0100
@@ -480,7 +480,7 @@
         elif operator == '=' and isinstance(value, Constant) and \
                  value.type is None:
             operator = 'IS'
-        assert operator in ('<', '<=', '=', '>=', '>', 'ILIKE', 'LIKE', 'IS'), operator
+        assert operator in ('=', '<', '<=', '>=', '>', 'ILIKE', 'LIKE', 'IS'), operator
         self.operator = operator.encode()
         if value is not None:
             self.append(value)
--- a/stcheck.py	Thu Oct 15 20:20:29 2009 +0200
+++ b/stcheck.py	Wed Dec 23 08:52:54 2009 +0100
@@ -146,10 +146,10 @@
                 rtype = graph[(tovar, fromvar)]
                 cardidx = 1
             rschema = self.schema.rschema(rtype)
-            for rdef in rschema.iter_rdefs():
+            for rdef in rschema.rdefs.itervalues():
                 # XXX aggregats handling needs much probably some enhancements...
                 if not (tovar in select.aggregated
-                        or rschema.rproperty(rdef[0], rdef[1], 'cardinality')[cardidx] in '?1'):
+                        or rdef.cardinality[cardidx] in '?1'):
                     return False
             fromvar = tovar
         return True