[sorted navigation] refactor code so that when an attribute is found, nb_chars may be recomputed anyway according to variable type
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Thu, 24 Nov 2011 17:00:09 +0100
changeset 8101 f9fa2f47572c
parent 8100 21918a60a5c5
child 8102 619d41a4c770
[sorted navigation] refactor code so that when an attribute is found, nb_chars may be recomputed anyway according to variable type
web/views/navigation.py
--- a/web/views/navigation.py	Thu Nov 24 16:59:32 2011 +0100
+++ b/web/views/navigation.py	Thu Nov 24 17:00:09 2011 +0100
@@ -231,10 +231,11 @@
                         relvar = rel.children[0].variable
                     col = relvar.selected_index()
                 if col is not None:
-                    return col, attrname
-            # no relation but maybe usable anyway if selected
-            col = var.selected_index()
-            attrname = None
+                    break
+            else:
+                # no relation but maybe usable anyway if selected
+                col = var.selected_index()
+                attrname = None
             if col is not None:
                 # if column type is date[time], set proper 'nb_chars'
                 if var.stinfo['possibletypes'] & frozenset(('TZDatetime', 'Datetime',