handle attribute selection on variable selected using MAX() stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 09 Jul 2009 14:58:55 +0200
branchstable
changeset 2352 734eb79680e9
parent 2351 dddee537e4d5
child 2353 b11f1068a0d3
child 2358 fc7963340257
handle attribute selection on variable selected using MAX()
rset.py
--- a/rset.py	Thu Jul 09 14:58:19 2009 +0200
+++ b/rset.py	Thu Jul 09 14:58:55 2009 +0200
@@ -537,10 +537,12 @@
     for i, term in enumerate(rqlst.selection):
         if i == index:
             continue
-        try:
-            # XXX rewritten const
-            var = term.variable
-        except AttributeError:
+        # XXX rewritten const
+        # use iget_nodes for (hack) case where we have things like MAX(V)
+        for vref in term.iget_nodes(nodes.VariableRef):
+            var = vref.variable
+            break
+        else:
             continue
         #varname = var.name
         for ref in var.references():