move valuable_references from Variable to Referencable, it makes sense for ColumnAliases as well stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 29 Mar 2012 13:56:21 +0200
branchstable
changeset 691 4c8790030e0c
parent 690 43fc51a17f49
child 692 55af3a14cc29
move valuable_references from Variable to Referencable, it makes sense for ColumnAliases as well
nodes.py
--- a/nodes.py	Thu Mar 22 10:13:32 2012 +0100
+++ b/nodes.py	Thu Mar 29 13:56:21 2012 +0200
@@ -1,4 +1,4 @@
-# copyright 2004-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2004-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
 #
 # This file is part of rql.
@@ -1076,6 +1076,13 @@
                 return rel
         return None
 
+    def valuable_references(self):
+        """return the number of "valuable" references :
+        references is in selection or in a non type (is) relations
+        """
+        stinfo = self.stinfo
+        return len(stinfo['selected']) + len(stinfo['relations'])
+
 
 class ColumnAlias(Referenceable):
     __slots__ = ('colnum', 'query',
@@ -1125,11 +1132,4 @@
     def __repr__(self):
         return '%s(%#X)' % (self.name, id(self))
 
-    def valuable_references(self):
-        """return the number of "valuable" references :
-        references is in selection or in a non type (is) relations
-        """
-        stinfo = self.stinfo
-        return len(stinfo['selected']) + len(stinfo['relations'])
 
-